0.0.3 • Published 8 years ago
hosttool v0.0.3
hosttool
install
for script
npm install hosttool
for cmd
npm install hosttool -g
usage
for script
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)
})
for cmd
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'