$ npm install nypm
Unified Package Manager for Node.js
🚧 This project is under development. Please follow issues for the roadmap. 🚧
✅ Supports npm, yarn and pnpm out of the box with a unified API
✅ Provides an API interface to interact with package managers
✅ Autodetects project's package manager using package.json and known lockfiles
✅ Auto-installs and use exactly expected version of package manager using nodejs/corepack
✅ Zero dependency and low overhead implementation
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 |
+------------------------------------+
[TBA]
Install package:
# npm
npm install nypm
# yarn
yarn add nypm
# pnpm
pnpm install nypm
Import:
// ESM
import { detectPackageManager, installDependency } from 'nypm'
// CommonJS
const { detectPackageManager, installDependency } = require('nypm')
corepack enable (use npm i -g corepack for Node.js < 16.10)pnpm installpnpm devNYPM is inspired from previous attempts and projects for unifying package manager exeperience.
Made with 💛
Published under MIT License.
© 2010 - cnpmjs.org x YWFE | Home | YWFE