hosts-util
Parse and stringify hosts file.
Installation
npm install hosts-util --save
API
parse(hosts: string)
const hostsUtil = const hosts = fs hostsUtil // deep equals to localhost: '127.0.0.1' 'www.example.com': '192.168.0.1' 'www.example.org': '192.168.0.1'
stringify(data: object, params: object)
const hostsUtil = hostsUtil // equals to // 127.0.0.1 localhost// 192.168.0.1 www.example.com// 192.168.0.1 www.example.org hostsUtil // equals to // 127.0.0.1 localhost// 192.168.0.1 www.example.com// 192.168.0.1 www.example.org
License
MIT