get-hosts

2.0.1 • Public • Published

get-hosts Build Status

etc/hosts as an array of objects.

Install

$ npm install --save get-hosts

Usage

var getHosts = require('get-hosts');
 
getHosts(); // sync
 
getHosts(function(err,hosts){
    if(!err) console.log(hosts);
});
 
/*[ { 'local.dev': '127.0.0.1' },
  { localhost: '127.0.0.1' },
  { broadcasthost: '255.255.255.255' },
  { 'localhost~ ': '::1' } ]*/
 

Related

License

MIT © Hemanth.HM

Package Sidebar

Install

npm i get-hosts

Weekly Downloads

14

Version

2.0.1

License

MIT

Last publish

Collaborators

  • hemanth