[UNMAINTAINED] Manipulate the /etc/hosts file
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
LICENSE
README.md
package.json
testReplace.js

README.md

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