Skip to content
forked from unjs/nypm

๐ŸŒˆ Unified Package Manager for Node.js

License

Notifications You must be signed in to change notification settings

thegostisdead/nypm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

21 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒˆ nypm

npm version npm downloads Github Actions Codecov

Unified Package Manager for Node.js

๐Ÿšง This project is under development. Please follow issues for the roadmap. ๐Ÿšง

What does nypm do?

โœ… 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            |
  +------------------------------------+

CLI Usage

[TBA]

API Usage

Install package:

# npm
npm install nypm

# yarn
yarn add nypm

# pnpm
pnpm install nypm

Import:

// ESM
import { detectPackageManager, addDependency } from 'nypm'

// CommonJS
const { detectPackageManager, addDependency } = require('nypm')

๐Ÿ’ป Development

  • Clone this repository
  • Play Nyan Cat in the background (really important!)
  • Enable Corepack using corepack enable (use npm 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.

About

๐ŸŒˆ Unified Package Manager for Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%