npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

host-cli

v1.0.4

Published

a cli to modify host file on osx

Downloads

6

Readme

host-cli

a cli to modify host file on osx

这个库定义了一个zhost cli,该cli可以展示、修改osx系统下的host文件(/etc/hosts)。以此来学习如何开发基于node 的cli。

安装

yarn

yarn global add host-cli

npm

npm install -g host-cli

使用

zhost

展示目前的hosts配置

zhost add ip host -m “comment”

在host文件首行插入ip host的绑定, 后面会加上注释“comment”,并输出修改后的host文件内容

zhost add 127.0.0.0 localhost -m "本地host" 输出127.0.0.0 localhost # 本地host

zhost use <linenumber...>:

有时需要使用被注释掉的host绑定

zhost use 2 3 22 11 这样会去掉第2,3,22,11行的行首的第一个‘#’ ,并输出修改后的host文件内容

zhost un <linenumber...>

不需要用某个host绑定的时候就给这些行加上注释

zhost un 2 5 8 这样会给第2,5,8行的开头加上‘#’,并输出修改后的host文件内容

zhost del <linenumber...>

删除指定的行 zhost del 1 2 3 10 33 删除第1 2 3 10 33行,并输出修改后的host文件内容

备份

以上所有的修改操作,都会将修改前的文件存放到/etc/hosts.bac文件中

版本说明

1.0.1

1.0.2

zhost add 考虑到在首行加会改变以前的host的行号,你可能已经记熟了之前的某些绑定的行号,突然改变的话可能会不习惯,所以改成在末行增加。

1.0.3

zhost use 会去掉行首所有的空格和#,之前只会去掉开头的#,如果有空格就无法匹配,如果有多个#也只能重复执行zhost use,现在只需要执行一次。