1.2.2 • Published 10 years ago

hosthandler v1.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Base info

Hosthandler can cover a old host and add a new host.

Usage

npm install hosthandler
var hosthandler = require('hosthandler');

hosthandler.update('127.0.0.1', 'wwww.iamhosthandler.com');

hosthandler.update('127.0.1.6', 'wwww.iamhosthandlers.com', function () {
    fs.readFile('/etc/hosts', 'utf-8', function(err, data) {
        console.log(data);
    });
});

hosthandler.update(['127.0.0.9', '11.11.11.11'], ['wwww.iamhosthandler.com', 'www.isipright.com']);

hosthandler.update(['127.0.0.9', '11.11.11.11'], ['wwww.iamhosthandler.com', 'www.isipright.com'], function () {
    fs.readFile('/etc/hosts', 'utf-8', function(err, data) {
        console.log(data);
    });
});

ATTENTION

Hosthandler can not update the host file if permission not allow.

sudo node app.js

LICENSE

MIT

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.9

10 years ago

1.1.8

10 years ago

1.1.7

10 years ago

1.1.6

10 years ago

1.1.5

10 years ago

1.1.4

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.0

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago