https://github.com/dhruwlalan/opm
Use only-package-manager to run the right package manager.
https://github.com/dhruwlalan/opm
node-cli npm package-manager pnpm yarn
Last synced: 5 months ago
JSON representation
Use only-package-manager to run the right package manager.
- Host: GitHub
- URL: https://github.com/dhruwlalan/opm
- Owner: dhruwlalan
- License: mit
- Created: 2021-04-28T09:39:12.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-03T15:27:28.000Z (over 3 years ago)
- Last Synced: 2025-06-26T08:45:03.331Z (6 months ago)
- Topics: node-cli, npm, package-manager, pnpm, yarn
- Language: TypeScript
- Homepage: http://npm.im/@dhruwlalan/opm
- Size: 69.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## only-package-manager
> Use only-package-manager to run the right package manager.
[](https://github.com/dhruwlalan/only-package-manager/blob/master/LICENSE) [](https://www.npmjs.com/package/only-package-manager) [](https://www.npmjs.com/package/only-package-manager)
## Why
Currently there are three main nodejs package managers, namely - `npm`, `yarn` & `pnpm`.
Some projects use `npm` or some uses `yarn` or `pnpm`. Having to remember the syntax of all three is quite confusing for me and might be for you.
Therefor using `only-package-manager` I have to just remember **ONE** default syntax for all the basic & the mostly used commands and the CLI will take care of running the right command based on the package manager the project is using.
I made this project getting inspired by [@antfu](https://github.com/antfu)'s [`ni`](https://github.com/antfu/ni) project and wanted to make one with my own set of syntax & to practice TypeScript. So a Huge credit to Him🙌
## Installation
```
npm i -g only-package-manager
```
## Usage
##### Install all dependencies for a project.
```bash
$ opm
$ opm i # same as the above.
```
##### Install package/packages
```bash
$ opm i # saved to dependencies.
$ opm i -d # saved to devDependencies.
$ opm i -p # saved to peerDependencies.
$ opm i -o # saved to optionalDependencies.
$ opm i -e # saved with the exact version specified.
$ opm i -g # saved globally on npm.
```
> Note: currently all global commands are set to use only npm.
##### Remove package/packages
```bash
$ opm r # removes locally installed package.
$ opm r -g # removes globally installed package.
```
##### Run scripts defined in your package.json
```bash
$ opm run # Interactively select the script to run.
$ opm # runs the script named .
$ opm run # same as the above.
```
##### List all the packages
```bash
$ opm list # List all locally installed packages.
$ opm list -g # List all globally installed packages in npm.
```
##### Clean Install / Frozen Install
```bash
$ opm ci
```
##### Run a security audit.
```bash
$ opm audit
$ opm audit fix # automatically fix (only works on npm).
```
##### Check for outdated packages.
```bash
$ opm outdated # Check for all outdated packages.
```
##### Update packages
```bash
$ opm up # Updates all packages, adhering to ranges specified in package.json.
$ opm up -l # Updates all packages to their latest version.
$ opm up -g # Updates all globally installed packages.
$ opm up # Updates
$ opm up -l # Updates to the latest version.
```