π nypm
Unified Package Manager for Node.js
What does nypm do?
nypm, detects package manager type and version and converts command into package manager CLI arguments. It then uses corepack to execute package manager's command (and download it if necessary).
+------------------------------------+
| nypm |
+------------------------------------+
+------------------------------------+
| Corepack |
+------------------------------------+
+---------+ +---------+ +---------+
| npm | | yarn | | pnpm |
+---------+ +---------+ +---------+
+------------------------------------+
| Node.js project |
+------------------------------------+
CLI Usage
[TBA]
API Usage
Install package:
# npm
npm install nypm
# pnpm
pnpm install nypm
# yarn
yarn add nypm
Import:
// ESM
import {
detectPackageManager,
installDependencies,
addDependency,
addDevDependency,
removeDependency,
} from "nypm";
// CommonJS
const {
detectPackageManager,
installDependencies,
addDependency,
addDevDependency,
removeDependency,
} = require("nypm");
π» Development
- Clone this repository
- Play Nyan Cat in the background (really important!)
- Enable Corepack using
corepack enable
(usenpm i -g corepack
for Node.js < 16.10) - Install dependencies using
pnpm install
- Run interactive tests using
pnpm dev
Related Projects
NYPM is inspired from previous attempts and projects for unifying package manager exeperience.
License
Made with
Published under MIT License.