{"id":13561333,"url":"https://github.com/unjs/nypm","last_synced_at":"2026-01-20T14:03:37.893Z","repository":{"id":64353104,"uuid":"575022086","full_name":"unjs/nypm","owner":"unjs","description":"🌈 Unified Package Manager for Node.js (npm, pnpm, yarn), Bun and Deno","archived":false,"fork":false,"pushed_at":"2025-11-20T19:17:31.000Z","size":1828,"stargazers_count":653,"open_issues_count":22,"forks_count":33,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-01-14T03:15:05.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-06T15:26:07.000Z","updated_at":"2026-01-09T23:52:12.000Z","dependencies_parsed_at":"2023-10-30T19:35:26.770Z","dependency_job_id":"132a902f-7812-4f9c-8e6e-53dd93850d5c","html_url":"https://github.com/unjs/nypm","commit_stats":{"total_commits":34,"total_committers":4,"mean_commits":8.5,"dds":"0.11764705882352944","last_synced_commit":"28b219e25c75271073e19082fccd9ad9e4f63931"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/unjs/nypm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fnypm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fnypm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fnypm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fnypm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unjs","download_url":"https://codeload.github.com/unjs/nypm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unjs%2Fnypm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:00:55.022Z","updated_at":"2026-01-20T14:03:37.883Z","avatar_url":"https://github.com/unjs.png","language":"TypeScript","funding_links":[],"categories":["TypeScript","others"],"sub_categories":[],"readme":"# 🌈 nypm\n\n\u003c!-- automd:badges color=\"yellow\" codecov --\u003e\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\u003c!-- /automd --\u003e\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) and [deno](https://deno.com/) 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. 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\u003e [!NOTE]\n\u003e 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(\u003cpm\u003e, { short?, frozenLockFile? })`\n\nGet the command to install dependencies with the package manager.\n\n### `addDependencyCommand(\u003cpm\u003e, \u003cname\u003e, { dev?, global?, workspace?, yarnBerry?, short? })`\n\nGet the command to add a dependency with the package manager.\n\n### `runScriptCommand(\u003cpm\u003e, \u003cname\u003e, { args? })`\n\nGet the command to run a script with the package manager.\n\n### `dlxCommand(\u003cpm\u003e, \u003cname\u003e, { 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\u003c!-- Badges --\u003e\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\u0026style=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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fnypm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funjs%2Fnypm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funjs%2Fnypm/lists"}