{"name":"nypm","version":"0.6.0","license":"MIT","_id":"nypm@0.6.0","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":"3a04623d1c358a93fc4b3cb9cfb6a11af080feca","tarball":"http://registry-npm.ywwl.com/nypm/download/nypm-0.6.0.tgz","fileCount":9,"integrity":"sha512-mn8wBFV9G9+UFHIrq+pZ2r2zL4aPau/by3kJb3cM7+5tQHMt6HGQB8FDIeKFYp8o0D2pnH6nVsO88N4AmUxIWg==","signatures":[{"sig":"MEUCIQDeMW9WAgbh0fpfLqBFsTuoZs1xwINlrzGsjy0Uptv2KgIgOik8Wt1UwyFVNCJdKGhddPbZ+gCq8F3rGBTkAFolQMM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27670,"size":7595,"noattachment":false,"key":"/nypm/-/nypm-0.6.0.tgz"},"type":"module","_from":"file:nypm-0.6.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":"^14.16.0 || >=16.10.0"},"exports":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"scripts":{"dev":"vitest dev","lint":"eslint . && prettier -c src test","nypm":"jiti src/cli.ts","test":"pnpm lint && pnpm test:types && vitest run --coverage","build":"automd && unbuild","release":"pnpm test && pnpm build && changelogen --release --push && pnpm publish","lint:fix":"eslint . --fix && prettier -w src test","test:types":"tsc --noEmit"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"_resolved":"/tmp/00705dcea8d7a70d012423efcc45dbb7/nypm-0.6.0.tgz","_integrity":"sha512-mn8wBFV9G9+UFHIrq+pZ2r2zL4aPau/by3kJb3cM7+5tQHMt6HGQB8FDIeKFYp8o0D2pnH6nVsO88N4AmUxIWg==","repository":{"url":"git+https://github.com/unjs/nypm.git","type":"git"},"_npmVersion":"10.9.2","description":"Unified Package Manager for Node.js","directories":{},"sideEffects":false,"_nodeVersion":"22.14.0","dependencies":{"citty":"^0.1.6","pathe":"^2.0.3","consola":"^3.4.0","tinyexec":"^0.3.2","pkg-types":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"ufo":"^1.5.4","jiti":"^2.4.2","automd":"^0.3.12","eslint":"^9.21.0","vitest":"^3.0.7","std-env":"^3.8.0","unbuild":"^3.3.1","prettier":"^3.5.2","typescript":"^5.7.3","@types/node":"^22.13.5","changelogen":"^0.5.7","eslint-config-unjs":"^0.4.2","@vitest/coverage-v8":"^3.0.7"},"_npmOperationalInternal":{"tmp":"tmp/nypm_0.6.0_1740505514799_0.6164229103363181","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":1740505514966,"_cnpm_publish_time":1740505514966,"dist-tags":{"latest":"0.6.12","latest-0.1":"0.1.1"}}