node-command-tools

1.0.2 • Public • Published

node-command-tools

cpuinfo/IP address/Ping another web url/wifi controller

Install

npm install node-command-tools --dev

Getting Start

const { GetProcessorID, GetCpuInfo, Ping, GetIp, NetSh } = require("node-system");

// cup serial number
GetProcessorID().then(cupid => {
    console.log(cupid)
})
// cup information
GetCpuInfo().then(cupinfo => {
    console.log(cupinfo);
})

// network latency
const pingClient = Ping("www.baidu.com");
pingClient().then(val => {
    console.log(val)
}).catch(err => {
    console.log(err)
})

// ip address
GetIp().then(val => {
    console.log(123,val) 
})   

// wifi controll
const net_shell = NetSh();
net_shell.scan().then(list => {
    console.log('networks:', list)
})
net_shell.currentConnect().then(val => {
    console.log('currentConnect', val)
})
net_shell.disconnect().then(val => {
    console.log(val.length)
    if (!val) {
        console.log("断开失败")
    } else {
        console.log(val)
    }clear
})
net_shell.connnect({ ssid: 'ssid', password: 'password' }, 
function success(text) {
    console.log(text)
},
function error (err) {
    console.log(err)
}
)

Readme

Keywords

none

Package Sidebar

Install

npm i node-command-tools

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

111 kB

Total Files

36

Last publish

Collaborators

  • allen_sun