Updated Examples (markdown)

Namhyeon Go 2020-11-15 06:04:31 +09:00
parent cf842ca8b5
commit fbca5db82e

@ -23,7 +23,7 @@ HTTP.create()
if ("error" in res) { if ("error" in res) {
console.error(res.error.message); console.error(res.error.message);
} else if ("data" in res) { } else if ("data" in res) {
console.log("ok"); console.log(res.name);
} }
}) })
; ;
@ -38,7 +38,11 @@ HTTP.create()
.setBearerAuth(token) .setBearerAuth(token)
.setUseCache(false) .setUseCache(false)
.get(apiUrl + "myproject/items/mycollection", function(res) { .get(apiUrl + "myproject/items/mycollection", function(res) {
alert(res.name); if ("error" in res) {
console.error(res.error.message);
} else if ("data" in res) {
console.log(res.name);
}
}) })
; ;
``` ```
@ -61,6 +65,7 @@ var WMI = require("lib/wmi");
var ping = function(address) { var ping = function(address) {
return WMI.execQuery("Select * From Win32_PingStatus where address='" + address + "'").fetch().get("ResponseTime"); return WMI.execQuery("Select * From Win32_PingStatus where address='" + address + "'").fetch().get("ResponseTime");
}; };
console.log(ping("1.1.1.1"));
``` ```
## XML Parse ## XML Parse