hostrc
An alternate host-switch minimal solution of SwitchHosts&& multiple-host
Thanks to guankaishe for donating the npm package name!
Features
- Declaration with hostrc config file
- Minimal dependency && Quick installation
- No dns cache && live-refresh
- Support http && https proxy
- Support cli && api usages
Install
npm install --save hostrc
Usages
touch hostrc(default config file)
127.0.0.1 baidu.com
127.0.0.1 q.baidu.com
1) cli
read default config file from process.pwd() + ‘/hostrc’ && start
install as binary module
$ [sudo] npm i -g hostrc
use in cli
$ hrc or hostrc
if don’t want open url in chrome
export HOSTRC_OPEN=false
2) api
open brower with blank url
require('hostrc')('./hostrc')
open brower with default url
require('hostrc')('./hostrc2', '127.0.0.1:3000')
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
History
- v1.0.0 init
Welcome fork and feekback
- write by
i5ting
i5ting@126.com
License
this repo is released under the MIT License.