π Unified Package Manager for Node.js (npm, pnpm, yarn), Bun and Deno.
β Supports npm, yarn, pnpm and bun and deno 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.
β corepack integration for pnpm and yarn.
Install dependencies:
npx nypm i
Add a dependency:
npx nypm add defu
Remove a dependency:
npx nypm remove defu
Install package:
# β¨ Auto-detect
npx nypm install nypm
# npm
npm install nypm
# yarn
yarn add nypm
# pnpm
pnpm install nypm
# bun
bun install nypm
# deno
deno install nypm
Import:
// ESM
import { addDependency } from "nypm";
// CommonJS
const { addDependency } = require("nypm");
Adds dependency to the project.
Adds dev dependency to the project.
Detect the package manager used in a directory (and up) by checking various sources:
- Use
packageManager
field from package.json - Known lock files and other files
Ensures dependency is installed.
Installs project dependencies.
Removes dependency from the project.
- Clone this repository
- Play Nyan Cat in the background (really important!)
- Enable Corepack using
corepack enable
- Install dependencies using
pnpm install
- Run interactive tests using
pnpm dev
NYPM is inspired from previous attempts and projects for unifying package manager experience.
Made with π
Published under MIT License.