only-allow-many

1.2.2 • Public • Published

only-allow

Force a specific package manager to be used on a project

Usage

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

If you want to force npm, add:

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

If you want to force cnpm, add:

{
  "scripts": {
    "preinstall": "npx only-allow cnpm"
  }
}

If you want to force pnpm, add:

{
  "scripts": {
    "preinstall": "npx only-allow pnpm"
  }
}

If you want to force yarn, add:

{
  "scripts": {
    "preinstall": "npx only-allow yarn"
  }
}

If you want to force bun, add:

{
  "scripts": {
    "preinstall": "npx only-allow bun"
  }
}

Multiple package managers

If you want to allow multiple package managers, add:

{
  "scripts": {
    "preinstall": "npx only-allow npm bun"
  }
}

License

MIT

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i only-allow-many

    Weekly Downloads

    838

    Version

    1.2.2

    License

    MIT

    Unpacked Size

    5.02 kB

    Total Files

    4

    Last publish

    Collaborators

    • rharkor