[UNMAINTAINED] Manipulate the /etc/hosts file
  • JavaScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2016-12-02 23:21:39 +01:00
lib Initial 2012-12-23 13:48:26 +01:00
test Initial 2012-12-23 13:48:26 +01:00
LICENSE Meta meta meta 2012-12-23 12:40:32 +01:00
package.json Initial 2012-12-23 13:48:26 +01:00
README.md This project is unmaintained 2016-12-02 23:21:39 +01:00
testReplace.js Initial 2012-12-23 13:48:26 +01:00

This project is not actively maintained

Issues and pull requests on this repository may not be acted on in a timely manner, or at all. You are of course welcome to use it anyway. You are even more welcome to fork it and maintain the results.

Unmaintained

node-hostsfile

Manipulate the /etc/hosts file.

var hf = require('./lib/hostsfile');

hf.readHostsFile(function (err, data) {
    if (err)
        throw err;

    var hosts = [
        {ip: '10.1.2.3', names: ['test1', 'test1-alias']},
    ];

    data = hf.addHosts(data, hosts, 'test');
    hf.replaceHostsFile(data, function (err) {
        if (err)
            throw err;
        console.log('Done');
    });
});

License

MIT