Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 578 Bytes

README.md

File metadata and controls

38 lines (28 loc) · 578 Bytes

only-allow2

需求来源于业务:https://juejin.cn/post/7067198104092540935

Force a specific package manager and it's version to be used on a project

Usage

Add a preinstall script to your project's package.json.

support:

  • npm
  • cnpm
  • yarn
  • pnpm

If you want to force npm, add:

{
  "scripts": {
    "preinstall": "npx only-allow2 npm"
  }
}

If you want to force package manager version, add:

{
  "scripts": {
    "preinstall": "npx only-allow2 [email protected]"
  }
}

License

MIT