{"name":"nypm","version":"0.6.4","license":"MIT","_id":"nypm@0.6.4","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/unjs/nypm#readme","bugs":{"url":"https://github.com/unjs/nypm/issues"},"bin":{"nypm":"dist/cli.mjs"},"dist":{"shasum":"fc67e207e0c8acbc641c4ed5d56bec4372fad8a8","tarball":"http://registry-npm.ywwl.com/nypm/download/nypm-0.6.4.tgz","fileCount":7,"integrity":"sha512-1TvCKjZyyklN+JJj2TS3P4uSQEInrM/HkkuSXsEzm1ApPgBffOn8gFguNnZf07r/1X6vlryfIqMUkJKQMzlZiw==","signatures":[{"sig":"MEQCIHMzL03TKM6yt9Xb3npOqvX8sz18QiV4QTT7x0crT2JaAiBVjeI1bywTnFb7bGD6upi2gC3E9FLyoVUU9p6ROWE3Tw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54337,"size":9285,"noattachment":false,"key":"/nypm/-/nypm-0.6.4.tgz"},"type":"module","_from":"file:nypm-0.6.4.tgz","types":"./dist/index.d.mts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":"./dist/index.mjs"},"scripts":{"dev":"vitest dev","lint":"eslint . && prettier -c src test","nypm":"node ./src/cli.ts","test":"pnpm lint && pnpm test:types && vitest run --coverage","build":"automd && obuild","release":"pnpm test && pnpm build && changelogen --release --push && pnpm publish","lint:fix":"eslint . --fix && prettier -w src test","test:types":"tsgo --noEmit"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"_resolved":"/tmp/1e999d447f546da4987d519e5a09ddd2/nypm-0.6.4.tgz","_integrity":"sha512-1TvCKjZyyklN+JJj2TS3P4uSQEInrM/HkkuSXsEzm1ApPgBffOn8gFguNnZf07r/1X6vlryfIqMUkJKQMzlZiw==","repository":{"url":"git+https://github.com/unjs/nypm.git","type":"git"},"_npmVersion":"11.6.2","description":"Unified Package Manager for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"25.2.1","dependencies":{"citty":"^0.2.0","pathe":"^2.0.3","tinyexec":"^1.0.2"},"_hasShrinkwrap":false,"devDependencies":{"ufo":"^1.6.3","automd":"^0.4.2","eslint":"^9.39.2","obuild":"^0.4.18","vitest":"^4.0.17","std-env":"^3.10.0","prettier":"^3.8.0","pkg-types":"^2.3.0","typescript":"^5.9.3","@types/node":"^25.0.9","changelogen":"^0.6.2","eslint-config-unjs":"^0.6.2","@vitest/coverage-v8":"^4.0.17","@typescript/native-preview":"7.0.0-dev.20260120.1"},"_npmOperationalInternal":{"tmp":"tmp/nypm_0.6.4_1768915834810_0.11835307137663209","host":"s3://npm-registry-packages-npm-production"},"readme":"# 🌈 nypm\n\n<!-- automd:badges color=\"yellow\" codecov -->\n\n[![npm version](https://img.shields.io/npm/v/nypm?color=yellow)](https://npmjs.com/package/nypm)\n[![npm downloads](https://img.shields.io/npm/dm/nypm?color=yellow)](https://npm.chart.dev/nypm)\n[![codecov](https://img.shields.io/codecov/c/gh/unjs/nypm?color=yellow)](https://codecov.io/gh/unjs/nypm)\n\n<!-- /automd -->\n\n🌈 Unified Package Manager for Node.js (npm, pnpm, yarn), Bun and Deno.\n\n✅ Supports [npm](https://docs.npmjs.com/cli/v10/commands/npm), [yarn](https://yarnpkg.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/package-manager), [deno](https://deno.com/), [aube](https://github.com/jdx/aube) and [nub](https://github.com/nubjs/nub) out of the box with a unified API.\n\n✅ Provides an **API interface** to interact with package managers.\n\n✅ **Autodetects** project's package manager using `package.json` and known lockfiles.\n\n✅ **[corepack](https://github.com/nodejs/corepack)** integration for **pnpm** and **yarn**.\n\n## `nypm` command\n\n**Install dependencies:**\n\n```sh\nnpx nypm i\n```\n\n**Add a dependency:**\n\n```sh\nnpx nypm add defu\n```\n\n**Remove a dependency:**\n\n```sh\nnpx nypm remove defu\n```\n\n## API Usage\n\nInstall package:\n\n```sh\n# ✨ Auto-detect\nnpx nypm install nypm\n```\n\nImport:\n\n```js\n// ESM import\nimport { addDependency } from \"nypm\";\n\n// or dynamic import\nconst { addDependency } = await import(\"nypm\");\n```\n\n### `addDependency(name, options)`\n\nAdds dependency to the project.\n\n### `addDevDependency(name, options)`\n\nAdds dev dependency to the project.\n\n### `detectPackageManager(cwd, options)`\n\nDetect the package manager used in a directory (and up) by checking various sources:\n\n1. Use `packageManager` field from package.json\n2. Use [`devEngines.packageManager`](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines) field from package.json\n3. Known lock files and other files\n\n### `ensureDependencyInstalled(name, options)`\n\nEnsures dependency is installed.\n\n### `installDependencies(options)`\n\nInstalls project dependencies.\n\n### `removeDependency(name, options)`\n\nRemoves dependency from the project.\n\n### `dedupeDependencies(options)`\n\nDedupe project dependencies.\n\n> [!NOTE]\n> For `bun` and `deno` it will remove the lockfile and reinstall all dependencies.\n\n### `runScript(name, options)`\n\nRuns a script defined in the `package.json` file.\n\n### `dlx(package, options)`\n\nDownload and execute a package with the package manager.\n\n### `installDependenciesCommand(<pm>, { short?, frozenLockFile? })`\n\nGet the command to install dependencies with the package manager.\n\n### `addDependencyCommand(<pm>, <name>, { dev?, global?, workspace?, yarnBerry?, short? })`\n\nGet the command to add a dependency with the package manager.\n\n### `runScriptCommand(<pm>, <name>, { args? })`\n\nGet the command to run a script with the package manager.\n\n### `dlxCommand(<pm>, <name>, { args?, short?, packages? })`\n\nGet the command to download and execute a package with the package manager.\n\n## 💻 Development\n\n- Clone this repository\n- Play [Nyan Cat](https://www.nyan.cat/) in the background (really important!)\n- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n- Install dependencies using `pnpm install`\n- Run interactive tests using `pnpm dev`\n\n## Related Projects\n\nNYPM is inspired from previous attempts and projects for unifying package manager experience.\n\n- [pi0/yarnpm](https://github.com/pi0/yarnpm)\n- [unjs/lmify](https://github.com/unjs/lmify)\n- [antfu/ni](https://github.com/antfu/ni)\n- [antfu/install-pkg](https://github.com/antfu/install-pkg)\n- [egoist/dum](https://github.com/egoist/dum)\n- [nodejs/corepack](https://github.com/nodejs/corepack)\n\n## License\n\nMade with 💛\n\nPublished under [MIT License](./LICENSE).\n\n<!-- Badges -->\n\n[npm-version-src]: https://img.shields.io/npm/v/nypm?style=flat-square\n[npm-version-href]: https://npmjs.com/package/nypm\n[npm-downloads-src]: https://img.shields.io/npm/dm/nypm?style=flat-square\n[npm-downloads-href]: https://npmjs.com/package/nypm\n[github-actions-src]: https://img.shields.io/github/actions/workflow/status/unjs/nypm/ci.yml?branch=main&style=flat-square\n[github-actions-href]: https://github.com/unjs/nypm/actions?query=workflow%3Aci\n[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/nypm/main?style=flat-square\n[codecov-href]: https://codecov.io/gh/unjs/nypm\n","publish_time":1768915834954,"_cnpm_publish_time":1768915834954,"dist-tags":{"latest":"0.6.12","latest-0.1":"0.1.1"}}