π Unified Package Manager for Node.js (npm, pnpm, yarn), Bun and Deno.
β Supports npm, yarn, pnpm, 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 iAdd a dependency:
npx nypm add defuRemove a dependency:
npx nypm remove defuInstall package:
# β¨ Auto-detect
npx nypm install nypmImport:
// ESM import
import { addDependency } from "nypm";
// or dynamic import
const { addDependency } = await import("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
packageManagerfield from package.json - Known lock files and other files
Ensures dependency is installed.
Installs project dependencies.
Removes dependency from the project.
Dedupe project dependencies.
Note
For bun and deno it will remove the lockfile and reinstall all dependencies.
Runs a script defined in the package.json file.
Download and execute a package with the package manager.
Get the command to install dependencies with the package manager.
Get the command to add a dependency with the package manager.
Get the command to run a script with the package manager.
Get the command to download and execute a package with the package manager.
- 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.