{"id":15204118,"url":"https://github.com/evanzhoudev/npm-confirm","last_synced_at":"2025-10-29T04:31:56.763Z","repository":{"id":231042233,"uuid":"780746796","full_name":"EvanZhouDev/npm-confirm","owner":"EvanZhouDev","description":"✅ Use the right JS package manager without thinking.","archived":false,"fork":false,"pushed_at":"2024-07-27T21:57:35.000Z","size":492,"stargazers_count":19,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T22:03:15.795Z","etag":null,"topics":["bun","nodejs","npm","pnpm","yarn"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/npm-confirm","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvanZhouDev.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-04-02T04:45:44.000Z","updated_at":"2025-01-20T20:33:30.000Z","dependencies_parsed_at":"2024-09-24T00:41:33.812Z","dependency_job_id":"3b5b8c08-45e8-4b74-b843-49fece5ddd2a","html_url":"https://github.com/EvanZhouDev/npm-confirm","commit_stats":null,"previous_names":["evanzhoudev/npm-confirm"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fnpm-confirm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fnpm-confirm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fnpm-confirm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvanZhouDev%2Fnpm-confirm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvanZhouDev","download_url":"https://codeload.github.com/EvanZhouDev/npm-confirm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238768422,"owners_count":19527197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bun","nodejs","npm","pnpm","yarn"],"created_at":"2024-09-28T05:21:35.753Z","updated_at":"2025-10-29T04:31:51.271Z","avatar_url":"https://github.com/EvanZhouDev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![npm Confirm Banner](./art/banner.png)\n\n\u003cp align=\"center\"\u003e\nUse the right JS package manager without thinking.\n\u003cbr\u003e\n\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e | \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\n\u003c/p\u003e\n\n## What is `npmc`?\n\n`npmc` is a wrapper for the `npm` command that _confirms with you if it detects you using another package manager_.\n\nWhen confirming, you can choose to do 3 things:\n\n1. Run your command, [**adapted for the new package manager**](#automatic-command-adaptation)\n2. Run your **original command**\n3. **Cancel** the operation\n\nNow, you can just copy and paste `npm install` commands from documentation without needing to manually edit the package manager!\n\n\u003cdetails\u003e\n\u003csummary\u003eWhy not \u003ccode\u003e@antfu/ni\u003c/code\u003e?\u003c/summary\u003e\n\nWhen aliased to just `npm`, `npmc` serves as a quick way to run commands copied from external sources without needing to modify it at all, as opposed to `ni`, which reqires you to still swap out the `npm install` bit.\n\nHowever, these tools can serve as compliments.\n\n- If you are typing commands directly, you can still choose to use `ni`.\n- You can use `npmc` in addition for copying and pasting or to catch occasional slipups.\n\n\u003c/details\u003e\n\n## Installation\n\n```bash\nnpm install -g npm-confirm\n```\n\nThis will give you access to the `npmc` command, which acts like the `npm` command, but confirms with you.\n\nI strongly recommend aliasing `npmc` to just `npm` so you can use `npm` like normal.\n\nTo do this in `zsh` or `bash` add this to your `.zshrc` or `.bashrc`:\n\n```bash\nalias npm='npmc'\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eWrapping \u003ccode\u003epnpm\u003c/code\u003e, \u003ccode\u003ebun\u003c/code\u003e, and \u003ccode\u003eyarn\u003c/code\u003e\u003c/summary\u003e\n\nYou may also want the `pnpm`, `bun`, and `yarn` commands to give confirmation when used with the wrong package manager.\n\nBy default, `npmc` acts as `npm` when no other package managers are detected. However, you can change that default by simply passing a `--[NAME]-alias` flag.\n\nFor example, if I run `npmc --pnpm-alias`, it will act as `pnpm` and confirm with you if you are using a non-`pnpm` package manager.\n\nAgain, I recommend aliasing these in `.zshrc`:\n\n```bash\n# npm\nalias npm='npmc'\n\n# pnpm\nalias pnpm='npmc --pnpm-alias'\n\n# bun\nalias bun='npmc --bun-alias'\n\n# yarn\nalias yarn='npmc --yarn-alias'\n```\n\n\u003c/details\u003e\n\n## Features\n\n### Automatic Command Adaptation\n\n`npmc` will automatically adapt agent subcommands and flags from one package manager to the other.\n\nFor example, NPM's `ci` command will automagically be converted to `bun install --no-save` for Bun, and accordingly for other package managers.\n\n### Command Preview\n\n`npmc` always shows you what command will be run, both when using the adapted package manager, or even the one you ran the command with.\n\nThis maximizes transparency, and ensures `npmc` never does something you didn't mean when adapting commands.\n\nHave a problem with command adaptation? Submit an issue!\n\n### Smart Confirmations\n\n`npmc` only confirms when you run certain commands, such as `install`, `uninstall`, `run`, `upgrade`, and their variants for the various package managers. This means that when you truly meant to use the other package manager, `npmc` will not stand in your way. Furthermore, all global installations are directly done directly with whatever you ran it with!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanzhoudev%2Fnpm-confirm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevanzhoudev%2Fnpm-confirm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevanzhoudev%2Fnpm-confirm/lists"}