{"_id":"hostify","_rev":"5-dae0010b314b8064df492059754d0245","name":"hostify","description":"CLI tool and utils for hosts files: /etc/hosts and C:\\Windows\\System32\\drivers\\etc\\hosts","dist-tags":{"latest":"0.3.0-beta.1"},"versions":{"0.1.0":{"name":"hostify","version":"0.1.0","description":"CLI tool and utils for hosts files: /etc/hosts and C:\\Windows\\System32\\drivers\\etc\\hosts","main":"index.js","bin":{"hostify":"bin/cmd.js"},"scripts":{"standard":"standard","pretest":"standard --fix","test":"exit 0"},"keywords":["hosts","host","domain","dns","ip"],"author":{"name":"Miguel Ángel Domínguez Coloma","email":"m@eridem.net","url":"http://eridem.net"},"license":"MIT","homepage":"http://eridem.net/hostify","bugs":{"url":"https://github.com/eridem/hostify/issues","email":"m@eridem.net"},"repository":{"type":"git","url":"git+ssh://git@github.com/eridem/hostify.git"},"dependencies":{"camelcase":"^4.0.0","chalk":"^1.1.3","require-dir":"^0.3.1","yargs":"^6.6.0"},"devDependencies":{"chai":"^3.5.0","mocha":"^3.2.0","nyc":"^10.0.0","standard":"^8.6.0"},"gitHead":"2f82178923f1b59208605618c736b53a7a0c9b3d","_id":"hostify@0.1.0","_shasum":"0ec380feadb4e0f444274b3cd67a309dc860673c","_from":".","_npmVersion":"3.10.10","_nodeVersion":"7.2.1","_npmUser":{"name":"eridem","email":"m@eridem.net"},"dist":{"shasum":"0ec380feadb4e0f444274b3cd67a309dc860673c","tarball":"https://registry.npmjs.org/hostify/-/hostify-0.1.0.tgz","integrity":"sha512-/2zCGaYck18E2T6Dt9OnM95PDRpJlf6r2D8V1COOP/tGdpdfg4MfcH8AmBWB8MHaF9h0ERVP7qgeb4xROupehQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbTBUTYX25m3gjlxmooGAvASiyQvjBkh/gfCUlk/6IiAiEAud/3/mqbRUgcsHt25UXz1cIpYlwMa84VkwtEcxJL5bU="}]},"maintainers":[{"name":"eridem","email":"m@eridem.net"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/hostify-0.1.0.tgz_1487527757820_0.09386292821727693"}},"0.2.0-beta.1":{"name":"hostify","version":"0.2.0-beta.1","description":"CLI tool and utils for hosts files: /etc/hosts and C:\\Windows\\System32\\drivers\\etc\\hosts","main":"index.js","bin":{"hostify":"bin/cmd.js"},"scripts":{"standard":"standard","pretest":"standard --fix","test":"exit 0"},"keywords":["hosts","host","domain","dns","ip"],"author":{"name":"Miguel Ángel Domínguez Coloma","email":"m@eridem.net","url":"http://eridem.net"},"license":"MIT","homepage":"http://eridem.net/hostify","bugs":{"url":"https://github.com/eridem/hostify/issues","email":"m@eridem.net"},"repository":{"type":"git","url":"git+ssh://git@github.com/eridem/hostify.git"},"config":{"ghooks":{"pre-commit":"npm test","pre-push":"npm test"}},"dependencies":{"camelcase":"^4.0.0","chalk":"^1.1.3","require-dir":"^0.3.1","yargs":"^6.6.0"},"devDependencies":{"chai":"^3.5.0","ghooks":"^2.0.0","mocha":"^3.2.0","nyc":"^10.0.0","standard":"^8.6.0"},"gitHead":"cb10ab6a3254a9048b6b8a2d0ac3b61082cd3b00","_id":"hostify@0.2.0-beta.1","_shasum":"a18efb7f4d4541edd10ffa80feb275b9dd25a120","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"eridem","email":"m@eridem.net"},"dist":{"shasum":"a18efb7f4d4541edd10ffa80feb275b9dd25a120","tarball":"https://registry.npmjs.org/hostify/-/hostify-0.2.0-beta.1.tgz","integrity":"sha512-TplW+ILYNwb7dkVbEJWuyqNHOc7yyQr7fObOp0KEHs5k3NPeKX8G2+9aeME3XcLsydD41ybXNJ9x0gDkPHS89w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBG+ppqRIDvmMqgtiCn/Ih3+dQVUdA9Yiqs60thDmWMGAiEAnQwHKb3UWoX6KefpI8dLj48hhT7BtjkOrjjrhbGa6JM="}]},"maintainers":[{"name":"eridem","email":"m@eridem.net"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/hostify-0.2.0-beta.1.tgz_1487706416536_0.11545060388743877"}},"0.2.0-beta.2":{"name":"hostify","version":"0.2.0-beta.2","description":"CLI tool and utils for hosts files: /etc/hosts and C:\\Windows\\System32\\drivers\\etc\\hosts","main":"index.js","bin":{"hostify":"bin/cmd.js"},"scripts":{"standard":"standard","pretest":"standard --fix lib/**/*.js","test":"npm run test-coverage","test-coverage":"nyc --cache mocha --timeout=8000 --check-leaks \"test/**/*.js\"","coveralls":"nyc report --reporter=text-lcov | coveralls","prepublish":"npm test"},"keywords":["hosts","host","domain","dns","ip"],"author":{"name":"Miguel Ángel Domínguez Coloma","email":"m@eridem.net","url":"http://eridem.net"},"license":"MIT","homepage":"http://eridem.net/hostify","bugs":{"url":"https://github.com/eridem/hostify/issues","email":"m@eridem.net"},"repository":{"type":"git","url":"git+ssh://git@github.com/eridem/hostify.git"},"config":{"ghooks":{"pre-commit":"npm test","pre-push":"npm test"}},"dependencies":{"camelcase":"^4.0.0","chalk":"^1.1.3","require-dir":"^0.3.1","yargs":"^6.6.0"},"devDependencies":{"chai":"^3.5.0","coveralls":"^2.11.16","ghooks":"^2.0.0","mocha":"^3.2.0","nyc":"^10.0.0","standard":"^8.6.0"},"gitHead":"aa98a7081651ec2c3767c37c30b07993d80daf79","_id":"hostify@0.2.0-beta.2","_shasum":"e20207144d2b319790da4aec3d44d0db3bdbfd0c","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"eridem","email":"m@eridem.net"},"dist":{"shasum":"e20207144d2b319790da4aec3d44d0db3bdbfd0c","tarball":"https://registry.npmjs.org/hostify/-/hostify-0.2.0-beta.2.tgz","integrity":"sha512-OAttLb3vP2wqfkpOEYAb2RZdOebpkfk3chuIaWnNEAB1Ij+OGhMk2AI26yrNrhATNxfH7jNsEZgt+zSKWoI47A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvkeK3/dJguH7LZQDk8tGJw25tgP8EWTre2bKJhMeq8AIgehDeLpCIMPPtz46VsIzuE1DtEopKJ5v46laasWAUpbg="}]},"maintainers":[{"name":"eridem","email":"m@eridem.net"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/hostify-0.2.0-beta.2.tgz_1487846795519_0.04951186012476683"}},"0.3.0-beta.1":{"name":"hostify","version":"0.3.0-beta.1","description":"CLI tool and utils for hosts files: /etc/hosts and C:\\Windows\\System32\\drivers\\etc\\hosts","main":"index.js","bin":{"hostify":"bin/cmd.js"},"scripts":{"standard":"standard","pretest":"standard --fix lib/**/*.js","test":"npm run test-coverage","test-coverage":"nyc --cache mocha --timeout=8000 --check-leaks \"test/**/*.js\"","coveralls":"nyc report --reporter=text-lcov | coveralls","prepublish":"npm test"},"keywords":["hosts","host","domain","dns","ip"],"author":{"name":"Miguel Ángel Domínguez Coloma","email":"m@eridem.net","url":"http://eridem.net"},"license":"MIT","homepage":"http://eridem.net/hostify","bugs":{"url":"https://github.com/eridem/hostify/issues","email":"m@eridem.net"},"repository":{"type":"git","url":"git+ssh://git@github.com/eridem/hostify.git"},"config":{"ghooks":{"pre-commit":"npm test","pre-push":"npm test"}},"dependencies":{"camelcase":"^4.0.0","chalk":"^1.1.3","require-dir":"^0.3.1","yargs":"^6.6.0"},"devDependencies":{"chai":"^3.5.0","coveralls":"^2.11.16","ghooks":"^2.0.0","mocha":"^3.2.0","nyc":"^10.0.0","standard":"^8.6.0"},"gitHead":"9774591e08c1c40efd8c04d093fc74fef4620dbf","_id":"hostify@0.3.0-beta.1","_shasum":"a71a47880c8ba6424b1516c23465c34532f588c1","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"eridem","email":"m@eridem.net"},"dist":{"shasum":"a71a47880c8ba6424b1516c23465c34532f588c1","tarball":"https://registry.npmjs.org/hostify/-/hostify-0.3.0-beta.1.tgz","integrity":"sha512-05OZaHQXtf95QYgFyNNLpfdE45Ecc/7RBrAcDwSUn+V1rcUWKW3djYIC6XXV0A0dCFk4Hyz1Cr8zuiGD8WQl1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFGgKYTsac1UAPc4uifP+ZrYUWwKqqrtvoQ9BO1r/34eAiAmfcVEpeauY2KQD+a0OSLbunVzrLl00jzbk8aggBWxag=="}]},"maintainers":[{"name":"eridem","email":"m@eridem.net"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/hostify-0.3.0-beta.1.tgz_1488034970045_0.4323420498985797"}}},"readme":"[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![NPM version][npm-image]][npm-url]\n[![js-standard-style][standard-image]][standard-url]\n\n[travis-url]: https://travis-ci.org/eridem/hostify\n[travis-image]: https://img.shields.io/travis/eridem/hostify/master.svg\n[standard-url]: http://standardjs.com/\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[npm-url]: https://www.npmjs.com/package/hostify\n[npm-image]: https://img.shields.io/npm/v/hostify.svg\n[coveralls-url]: https://coveralls.io/github/eridem/hostify?branch=master\n[coveralls-image]: https://coveralls.io/repos/github/eridem/hostify/badge.svg?branch=master\n\n# Hostify\n\n![Icon](https://github.com/eridem/hostify/raw/master/doc/icon.png) \n\n*Hostify* is a module that help us to work with the `hosts` file of our operating system.\n\nIt supports both a CLI tool and a module you can use in your own project.\n\n> *NOTE: library in progress. Please use with caution and report any issue on here: <https://github.com/eridem/hostify/issues>*\n\n## CLI tool operations\n\n```bash\n# Usage\nhostify [COMMAND] [OPTIONS]\n\n# For help\nhostify --help\nhostify [COMMAND] --help\n```\n\n| Command | Description | Example\n|:-- |:-- |:-- |\n| `list` | Show all entries in the host file | `hostify list` |\n| `list --ipFilterExp \"REGEXP\"` | Show entries which IPs match with RegExp | `hostify list --ipFilterExp \".*\\.255\"` |\n| `list --hostFilterExp \"REGEXP\"` | Show entries which Host match with RegExp | `hostify list --hostFilterExp \".*tracking.*\"` |\n| `list --ipFilterExp \"REGEXP\" --hostFilterExp \"REGEXP\"` | Show entries which IP and Host match with both each RegExp | `hostify list --ipFilterExp \"0.0.0.0\" --hostFilterExp \".*tracking.*\"` |\n| `add --ip \"IP\" --host \"HOST\" [--comment \"COMMENT\"]` | Add a single entry to the `hosts` file | `hostify add --ip \"0.0.0.0\" --host \"tracking.localhost\" --comment \"Tracking entry\"` |\n| `delete --ipFilterExp \"REGEXP\" [--what-if]` | Delete entries which IPs match with RegExp | `hostify delete --ipFilterExp \"127.0.0.\\d+\"` |\n| `delete --hostFilterExp \"REGEXP\" [--what-if]` | Delete entries which Host match with RegExp | `hostify delete --hostFilterExp \".*project\\.local\"` |\n\n### Special options\n\n| Option | Description | Example\n|:-- |:-- |:-- |\n| `--path` | Specify path of another `hosts` file | `hostify list --path ./my-hosts.txt` |\n\n## Module interface\n\nImport module with:\n\n```javascript\nconst hostify = require('hostify').operations\n```\n\n### List\n\n```typescript\nhostify.list(options): <Array>{ ip: string, host: string }`\n```\n\nShow entries in the host file.\n\n| Option | Model | Default |\n|:-- |:-- |:-- |\n| `filterIpFn` | `filterIpFn: (val: string) => boolean` | `(v) => true` |\n| `filterHostFn` | `filterHostFn: (val: string) => boolean` | `(v) => true` |\n| `path` | `path: string` | OS hosts path |\n\n```javascript\nconst options = {\n  filterIpFn: (val) => val.endsWith('.255'),       // Filter IPs\n  filterHostFn: (val) => val.contains('tracking')  // Filter Hosts\n  // path: './my-hosts-file.txt'                   // Hosts file\n}\n\nconst entries = hostify.list(options)\n\nentries.forEach(entry => console.log(entry.ip, entry.host, entry.comment))\n```\n\n### Add\n\n```typescript\nhostify.add(options): <Array>{ ip: string, host: string }\n```\n\nAdd entries in the host file.\n\n| Option | Model | Default |\n|:-- |:-- |:-- |\n| `entries` | `<Array>{ ip: string, host: string, comment: string }` | `null` |\n| `path` | `path: string` | OS hosts path |\n\n```javascript\nconst options = {\n  entries: [                                       // Entries to add\n    { ip: '0.0.0.0', host: 'ad.localhost' },\n    { ip: '0.0.0.0', host: 'tracking.localhost', comment: 'Track entry' }\n  ],\n  // path: './my-hosts-file.txt'                   // Hosts file\n}\n\nconst entries = hostify.add(options)\n\nentries.forEach(entry => console.log(entry.ip, entry.host, entry.comment))\n```\n\n### Delete\n\n```typescript\nhostify.delete(options): <Array>{ ip: string, host: string }\n```\n\nDelete entries in the host file.\n\n| Option | Model | Default |\n|:-- |:-- |:-- |\n| `filterIpFn` | `filterIpFn: (val: string) => boolean` | `(v) => true` |\n| `filterHostFn` | `filterHostFn: (val: string) => boolean` | `(v) => true` |\n| `whatIf` | `whatIf: boolean` | `false` |\n| `path` | `path: string` | OS hosts path |\n\n```javascript\nconst options = {\n  filterIpFn: (val) => val.endsWith('.255'),       // Filter IPs\n  filterHostFn: (val) => val.contains('tracking'), // Filter Hosts\n  whatIf: true                                     // Do not execute delete operation, only obtain results\n  // path: './my-hosts-file.txt'                   // Hosts file\n}\n\nconst entries = hostify.delete(options)\n\nentries.forEach(entry => console.log(entry.ip, entry.host, entry.comment))\n```","maintainers":[{"name":"eridem","email":"m@eridem.net"}],"time":{"modified":"2022-06-18T21:36:11.545Z","created":"2017-02-19T18:09:18.380Z","0.1.0":"2017-02-19T18:09:18.380Z","0.2.0-beta.1":"2017-02-21T19:46:57.208Z","0.2.0-beta.2":"2017-02-23T10:46:36.157Z","0.3.0-beta.1":"2017-02-25T15:02:50.658Z"},"homepage":"http://eridem.net/hostify","keywords":["hosts","host","domain","dns","ip"],"repository":{"type":"git","url":"git+ssh://git@github.com/eridem/hostify.git"},"author":{"name":"Miguel Ángel Domínguez Coloma","email":"m@eridem.net","url":"http://eridem.net"},"bugs":{"url":"https://github.com/eridem/hostify/issues","email":"m@eridem.net"},"license":"MIT","readmeFilename":"README.md"}