hostrc
发布于 7 年前 作者 i5ting 2311 次浏览 来自 分享

hostrc

An alternate host-switch minimal solution of SwitchHosts && multiple-host

npm version

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

History

  • v1.0.0 init

Welcome fork and feekback

License

this repo is released under the MIT License.

回到顶部