2 个不稳定版本
| 0.2.0 | 2022年11月12日 |
|---|---|
| 0.1.0 | 2022年11月11日 |
#13 in #node-modules
25KB
659 行
npx-bin-helper
npx-bin-helper 生成将 node_modules/.bin 添加到 PATH 的命令。支持 Linux、MacOS 和 Windows。
安装
cargo install npx-bin-helper
用法
npx-bin-helper -s <SHELL>
这将根据您的 shell 类型生成设置环境变量的命令。
当前 npx-bin-helper 支持以下 shell
bash(包括 Windows 上的 Git Bash)zshfishpowershell(Windows、MacOS、Linux)
例如
npx-bin-helper -s bash
输出
export _NPX_BIN="/path/to/project/node_modules/.bin"
export PATH="/path/to/project/node_modules/.bin:..."
要生成和自动评估在更改目录时更改的命令,您需要设置您的 shell。
Shell 设置
Bash
将以下内容添加到 .bashrc
eval "$(npx-bin-helper setup -s bash)"
Zsh
将以下内容添加到 .zshrc
eval "$(npx-bin-helper setup -s zsh)"
Fish
创建 ~/.config/fish/conf.d/npx-bin-helper.fish 并将以下内容添加到其中
npx-bin-helper setup -s fish | source
PowerShell
将以下内容添加到您的配置文件中
npx-bin-helper setup -s fish | Out-String | Invoke-Expression
许可协议
参考
依赖
~3–12MB
~115K SLoC