Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Unified Package Manager for Node.js and Bun
✅ Supports npm, yarn, pnpm and bun 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 supported package managers using nodejs/corepack when available.
✅ Minimal implementation.
nypm, detects package manager type and version and converts command into package manager CLI arguments. It then uses corepack or proper command to execute package manager's command and download it if necessary.
+------------------------------------------------+
| nypm |
+------------------------------------------------+
+-----------------------------------+ +---------+
| Corepack | | bun |
+-----------------------------------+ +---------+
+---------+ +---------+ +---------+
| npm | | yarn | | pnpm |
+---------+ +---------+ +---------+
nypm
CommandInstall dependencies:
npx nypm i
Add a dependency:
npx nypm add defu
Remove a dependency:
npx nypm remove defu
Install package:
# ✨ Auto-detect
npx nypm i nypm
# npm
npm install nypm
# yarn
yarn add nypm
# pnpm
pnpm install nypm
# bun
bun install nypm
Import:
// ESM
import { addDependency } from "nypm";
// CommonJS
const { addDependency } = require("nypm");
addDependency(name, options)
Adds dependency to the project.
addDevDependency(name, options)
Adds dev dependency to the project.
detectPackageManager(cwd, options)
Detect the package manager used in a directory (and up) by checking various sources:
packageManager
field from package.jsonensureDependencyInstalled(name, options)
Ensures dependency is installed.
installDependencies(options)
Installs project dependencies.
removeDependency(name, options)
Removes dependency from the project.
corepack enable
(use npm i -g corepack
for Node.js < 16.10)pnpm install
pnpm dev
NYPM is inspired from previous attempts and projects for unifying package manager exeperience.
Made with 💛
Published under MIT License.
FAQs
Unified Package Manager for Node.js
The npm package nypm receives a total of 3,554,205 weekly downloads. As such, nypm popularity was classified as popular.
We found that nypm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.