{"name":"nypm","version":"0.6.9","license":"MIT","_id":"nypm@0.6.9","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"bin":{"nypm":"./dist/cli.mjs"},"dist":{"shasum":"d7c2a2dffd94e1ca0349c721d73d6b776e22899c","tarball":"http://registry-npm.ywwl.com/nypm/download/nypm-0.6.9.tgz","fileCount":7,"integrity":"sha512-zxlE2yvSWZWmHcNdT3+5zV2lrCogeE9YOklHrR3dFjqutq5wO7GFDYLFDRXLsYnJzwvy/im9fYoxePvS0VTW0w==","signatures":[{"sig":"MEUCIEwYBOM3gZuKUP7MWGHQ2ppP9CxdvXFp60YjZlG3EnPIAiEA1MAMfMcHsQGwQ58iR1fEgrq8UmBfEzgKCugli2l41Hs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQDau5iEd6wXecUcU32+9uCz6Ma06SzO1uRCsNhJE8IfpQIgWZwanYaHLU7tCfNWsGxCb2WeJuYVJpT5TTWN3kRpvFI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51409,"size":9556,"noattachment":false,"key":"/nypm/-/nypm-0.6.9.tgz"},"type":"module","types":"./dist/index.d.mts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":"./dist/index.mjs"},"scripts":{"dev":"vitest dev","fmt":"oxlint . --fix && oxfmt src test","lint":"oxlint . && oxfmt --check 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","test:types":"tsc --noEmit"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"unjs/nypm","type":"git"},"description":"Unified Package Manager for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"24.18.0","dependencies":{"citty":"^0.2.2","pathe":"^2.0.3","tinyexec":"^1.2.4"},"_hasShrinkwrap":false,"devDependencies":{"ufo":"^1.6.4","oxfmt":">=0.60.0","automd":"^0.4.3","obuild":"^0.4.38","oxlint":"^1.75.0","vitest":"^4.1.10","std-env":"^4.2.0","pkg-types":"^2.3.1","typescript":"^6.0.3","@types/node":"^26.1.1","changelogen":"^0.6.2","expect-type":"^1.4.0","@volar/typescript":"^2.4.28","eslint-config-unjs":"^0.6.2","@vitest/coverage-v8":"^4.1.10","@volar/language-service":"^2.4.28"},"_npmOperationalInternal":{"tmp":"tmp/nypm_0.6.9_1785245153537_0.8503128060928657","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":1785245153618,"_cnpm_publish_time":1785245153618,"dist-tags":{"latest":"0.6.12","latest-0.1":"0.1.1"}}