Skip to content

🔨Hosthandler can update a old host and add a new host.

Notifications You must be signed in to change notification settings

kidbai/hosthandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

🔨Hosthandler can update a old host and add a new host.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published