Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mheob/use-correct-pm
A simple check of the usage of the correct package manager.
https://github.com/mheob/use-correct-pm
Last synced: 1 day ago
JSON representation
A simple check of the usage of the correct package manager.
- Host: GitHub
- URL: https://github.com/mheob/use-correct-pm
- Owner: mheob
- License: mit
- Created: 2022-11-10T17:28:14.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-26T05:16:38.000Z (9 months ago)
- Last Synced: 2024-05-01T21:58:29.595Z (9 months ago)
- Language: Go
- Size: 107 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Check for using the correct package manager
A simple check of the usage of the correct package manager.
## Usage
No installation is needed. Just run with `npx`.
### As script in `package.json`
Use one of the examples.
```jsonc
"scripts": {
"use-correct-pm": "npx use-correct-pm", // PNPM
"use-correct-pm": "npx use-correct-pm pnpm", // PNPM
"use-correct-pm": "npx use-correct-pm npm", // NPM
"use-correct-pm": "npx use-correct-pm yarn", // YARN
"use-correct-pm": "npx use-correct-pm bun", // BUN
},
```### As shell script
#### Default (same as `PNPM`)
Use `npx` if you use `NPM` as package manager.\
For `PNPM` and `YARN` use `exec` if you have installed the package in your project, otherwise use `dlx`.\
If you use `BUN` as your package manager use `bunx`.#### Check for `PNPM`
```sh
npx use-correct-pm
# or
npx use-correct-pm pnpm
```#### Check for `NPM`
```sh
npx use-correct-pm npm
```#### Check for `YARN`
```sh
npx use-correct-pm yarn
```#### Check for `BUN`
```sh
npx use-correct-pm bun
```### As git hook
For example used in combination with [husky](https://typicode.github.io/husky/).
```sh
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"[ -n "$CI" ] && exit 0
npx use-correct-pm
```