1.0.6 • Published 2 years ago

npm-limit v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

npm-limit

一个 node 包管理器的约束工具,用于协同项目的统一规范(约束大家使用同一种包管理在该项目中进行包的安装或者升级)。

A constraint tool for Node package manager, which is used to unify specifications for collaborative projects (binding everyone to install or upgrade packages in the project using the same package management).

使用方法

👉 : Just add a command to 'package.json'!

👉: 只需要在package.json中添加一条命令!

使用以下命令快速添加 👇

npm set-script preinstall "npx npm-limit yarn"

或者手动添加 👇

// package.json
{
  "scripts": {
    "preinstall": "npx npm-limit yarn"
  }
}

为了让其他人在此项目中只能通过我们指定的包管理器去安装依赖,我们需要在 package.json 里面添加一条脚本"preinstall": "npx npm-limit [你要设置的包管理器名称yarn,npm,pnpm...]"

To allow others to install dependencies in this project only through the package manager we specified,We need to add a script to 'package.json',"preinstall": "npx npm-limit [yarn,npm,pnpm...]"

示例

当我们设置了上述的 script 后,执行 pnpm i 可以看到如下图所示的报错信息

When we set the script above, we can execute pnpm i and see an error message as shown below npm.io

当我们没有设置"preinstall": "npx npm-limit [你要设置的包管理器名称yarn,npm,pnpm...]"或者设置错误的时候,可以看到如下图所示的报错信息

When we don't set "preinstall": "npx npm-limit [yarn,npm,pnpm...]",Or if the Settings are incorrect, you can see the error message as shown in the following figure npm.io

至此,包管理器的限制就可以实现啦 ~ 🥰

At this point, the package manager restriction is complete ~ 🥰

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago