https://github.com/cyanchanges/only-allow3
pnpm's only-allow with version constraints
https://github.com/cyanchanges/only-allow3
Last synced: 3 months ago
JSON representation
pnpm's only-allow with version constraints
- Host: GitHub
- URL: https://github.com/cyanchanges/only-allow3
- Owner: CyanChanges
- Created: 2025-01-25T09:27:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-18T07:51:00.000Z (about 1 year ago)
- Last Synced: 2025-10-30T11:35:43.353Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# only-allow3
pnpm's [Only Allow](https://github.com/pnpm/only-allow)
with version constraints support 😺.
## ✨ Usage
Put a `preinstall` script in your `package.json`
For example:
```json
{
"scripts": {
"preinstall": "npx only-allow3 bun"
}
}
```
### ⭐ Version Constraints
*❕ Use `bunx` instead of `npx` below cuz i hates npm💢 :(*
**🎉 SemVer Ranges are supported!**
🤔 Additionally,
you can add `@` after your favorite package manager,
and specify the version constraints.
Like:
```shell
$ only-allow3 bun@^1.1.45
```
**🟦 A few more examples:**
#### Force Bun ^1.1.45
```shell
$ bunx only-allow3 bun@^1.1.45 # Only Bun version matching ^1.1.45 will be allowed
```
#### Force Yarn 4.x
```shell
$ bunx only-allow3 yarn@4 # Only Yarn matching v4.x will be allowed
```
#### Force pnpm >= 9
```shell
$ bunx only-allow3 pnpm@>=9 # Only pnpm version greater or equal than 9 will be allowed
```