Updated Examples (markdown)

Namhyeon Go 2022-03-04 12:00:35 +09:00
parent 454bd1d652
commit c533e309cf

@ -1,9 +1,3 @@
# Examples of WelsonJS
* HTTP Request
* WMI Query
* XML Parse
## HTTP Request
### POST request with headers
@ -45,38 +39,4 @@ HTTP.create()
}
})
;
```
## WMI Query
### Get list of processes
```javascript
var WMI = require("lib/wmi");
var getProcesses = function() {
return WMI.execQuery("Select * From Win32_Process").fetchAll();
};
```
### Test network ping
```javascript
var WMI = require("lib/wmi");
var ping = function(address) {
return WMI.execQuery("Select * From Win32_PingStatus where address='" + address + "'").fetch().get("ResponseTime");
};
console.log(ping("1.1.1.1"));
```
## XML Parse
### Get value
```javascript
var XML = require("lib/xml");
var getAppName = function() {
return XML.load("config.xml").select("/Config/AppName").first().getText();
}
console.log(getAppName());
```