{"name":"nypm","version":"0.6.11","license":"MIT","_id":"nypm@0.6.11","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"bin":{"nypm":"./dist/cli.mjs"},"dist":{"shasum":"2db270c42ee16bc7a833a78f393b644e8c73d992","tarball":"http://registry-npm.ywwl.com/nypm/download/nypm-0.6.11.tgz","fileCount":7,"integrity":"sha512-wrVBTLWDu7nTUKGWplQebWOXWnhaIwyKQhBxobH/CGxJHoVw27r9vG5ba7kdZnxG+f4rC6dZd6m2oHmpkOcO7g==","signatures":[{"sig":"MEUCICA8yF/mNEhr8kcm8x9qQVicoASKsGZQmRWO8KHVcVc4AiEAiTEK7rVmKQqVAKLC5QzjevB2ofEz+QGNEzYFzRKBeWw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCICkk0wxNLcRIomB08BJp/bKOPuvIVQQPcnUddMtYIYPIAiEAwpYfqLMxi23pZWyOUECZoITHw5Uld0PtlVtoDeMk8uw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":52471,"size":9637,"noattachment":false,"key":"/nypm/-/nypm-0.6.11.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.21.0","dependencies":{"citty":"^0.2.2","pathe":"^2.0.3","tinyexec":"^1.3.1"},"_hasShrinkwrap":false,"devDependencies":{"ufo":"^1.6.4","oxfmt":"^0.73.0","automd":"^0.4.3","obuild":"^0.4.45","oxlint":"^1.88.0","vitest":"^5.0.5","std-env":"^4.3.0","pkg-types":"^2.3.3","typescript":"^7.0.2","@types/node":"^26.6.5","changelogen":"^0.6.2","expect-type":"^1.4.0","@volar/typescript":"^2.4.28","@vitest/coverage-v8":"^5.0.5","@volar/language-service":"^2.4.28"},"_npmOperationalInternal":{"tmp":"tmp/nypm_0.6.11_1792590396154_0.7682454734383761","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), [nub](https://github.com/nubjs/nub) and [upm](https://github.com/unjs/upm) 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":1792590396240,"_cnpm_publish_time":1792590396240,"dist-tags":{"latest":"0.6.12","latest-0.1":"0.1.1"}}