Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/prinsss/just-pnpm
Force the pnpm package manager to be used on a project.
https://github.com/prinsss/just-pnpm
npm package-manager pnpm
Last synced: 10 days ago
JSON representation
Force the pnpm package manager to be used on a project.
- Host: GitHub
- URL: https://github.com/prinsss/just-pnpm
- Owner: prinsss
- License: mit
- Created: 2023-10-16T08:49:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-20T11:45:41.000Z (11 months ago)
- Last Synced: 2024-10-21T02:15:24.480Z (17 days ago)
- Topics: npm, package-manager, pnpm
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# just-pnpm
This package utilizes npm package's `preinstall` and `postinstall` [scrips](https://docs.npmjs.com/cli/v9/using-npm/scripts) to restrict that only [pnpm](https://pnpm.io/) package manager could be used on a project.
It's developed as an alternative to `npx only-allow pnpm`, with some bugs fixed ([#15](https://github.com/pnpm/only-allow/issues/15), [#2660](https://github.com/npm/cli/issues/2660)).
## Installation
```
pnpm add -D just-pnpm
```## Usage
Add this package to your project's `devDependencies` and that's it.
If someone executes package installation commands other than pnpm (`npm install`, `yarn`, `cnpm install`, whatever.) on the project, they will get an error instead and installation will not proceed.
```json
{
"name": "your-project",
"devDependencies": {
"just-pnpm": "^1.0.1"
}
}
```For library developers, adding `just-pnpm` to your package's `dependencies` will prevent your library from being installed by any package managers except for pnpm. (not recommended though)
## Escape Hatches
Set environment variable `JUST_PNPM_SKIP_CHECK=true` to disable the check temporarily.
## Disclaimer
This package relies on [NPM lifecycle hooks](https://docs.npmjs.com/cli/v10/using-npm/scripts#npm-install) to work properly.
Although it's tested that the package works on many of popular package managers, a non-standard implementation or misbehavior could possibly break the functionality of package manager restriction.
## License
[MIT](LICENSE)