1.0.0 • Published 11 years ago

hostsfile v1.0.0

Weekly downloads
4
License
-
Repository
github
Last release
11 years ago

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