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

za-zi

v0.0.12

Published

自动选择包管理工具 ## install ```md npm i -g za-zi

Downloads

1

Readme

ZI

自动选择包管理工具

install

npm i -g za-zi

zi -v

zi

zi ==> zi.ts => runner.ts + parse.ts ==> install dep
zi

# npm install
# yarn install
# pnpm install
zi axios

# npm i axios
# yarn add axios
# pnpm add axios
zi @types/node -D

# npm i @types/node -D
# yarn add @types/node -D
# pnpm add -D @types/node
zi --frozen

# npm ci
# yarn install --frozen-lockfile
# pnpm install --frozen-lockfile
zi -g iroiro

# npm i -g iroiro
# yarn global add iroiro
# pnpm add -g iroiro

# 使用默认包管理工具,并不会和你的工作目录相关联

zi 自动获取包管理工具的途径有两种: 前者优先级较高

  1. 根据当前工作目录的包 lock 文件识别包管理工具或指定目录的 package.json 中的 packageManager 识别包管理工具,并提供本地环境异常识别辅助安装
  2. 根据配置文件识别,以下为配置规则
# ~/.zirc

# fallback when no lock found
currentAgent=npm 

# default "prompt"

# for global installs
globalAgent=npm

# ~/.bashrc

# custom configuration file path
export ZI_CONFIG_FILE="$HOME/.config/zi/zirc"

Zr

zr dev --port=3000

# npm run dev -- --port=3000
# yarn run dev --port=3000
# pnpm run dev -- --port=3000
zr

# interactively select the script to run
zr -

# return the last command

Zu - upgrade

zu

# npm upgrade
# yarn upgrade
# pnpm update
zu -i

# (not available for npm)
# yarn upgrade-interactive
# pnpm update -i

Zun - uninstall

zun axios

# npm uninstall axios
# yarn remove axios
# pnpm remove axios
zun @types/node -D

# npm uninstall @types/node -D
# yarn remove @types/node -D
# pnpm remove -D @types/node
zun -g eslint

# npm uninstall -g eslint
# yarn global remove eslint
# pnpm remove -g eslint

推荐配置

有了 zi 之后,我们再也不需要关注工作目录的包管理工具了,直接让 zi 接管你的 packageManager ,但如果你和我一样需要极致的开发体验(懒,不想多敲命令),可以配置以下达到最佳体验,当然前提是需要安装 item2on-my-zsh

# open zshrc
open ~/.zshrc

# into vi
i

将以下配置粘贴进入 zshrc 即可


alias s="zr start"
alias i="zi"
alias d="zr dev"
alias b="zr build"
alias bw="zr build --watch"
alias t="zr test"
alias tu="zr test -u"
alias tw="zr test --watch"
alias w="zr watch"
alias p="zr play"
alias c="zr typecheck"
alias lint="zr lint"
alias lintf="zr lint --fix"
alias release="zrrelease"
alias re="zr release"

OK,接下来你可以在你的 item2 输入 s 即代表 zr start ,然后 zr 会去自动寻找 packageManager 运行对应的命令,输入i 即代表 zi,当然,你也可以自己进行自定义。

Issues

如果 mac 当前用户无权限,则 zr-g 命令均会失效,解决方案是在终端输入 sudo chown -R USER_NAME ~/.npm