1.2.2 • Published 8 years ago

hosthandler v1.2.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 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

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago