npm install hosttool
npm install hosttool -g
const HostTool = require('hosttool');
const tool = new HostTool();
tool.list()
.then(hosts => {
console.log(hosts)
})
tool.add('127.0.0.1 wiliex.com #wiliex')
.then(()=> {
console.log('host is added')
})
tool.del('wiliex.com')
.then(()=> {
console.log('host is deleted')
})
tool.query('wiliex.com')
.then(host => {
console.log(host)
})
- query host by hostname
hosttool query wiliex.com
- list all the hosts
hosttool list
- delete host by hostname
hosttool del wiliex.com
- add host
hosttool add '127.0.0.1 wiliex.com #wiliex'