{"id":13483308,"url":"https://github.com/th0r/npm-upgrade","last_synced_at":"2025-05-16T17:08:23.190Z","repository":{"id":2200289,"uuid":"45927036","full_name":"th0r/npm-upgrade","owner":"th0r","description":"Interactive CLI utility to easily update outdated NPM dependencies","archived":false,"fork":false,"pushed_at":"2025-05-14T16:47:24.000Z","size":816,"stargazers_count":340,"open_issues_count":22,"forks_count":30,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-14T17:26:02.890Z","etag":null,"topics":["changelog","cli","deps","interactive","npm","outdated","packages","update","upgrade"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/th0r.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}},"created_at":"2015-11-10T17:04:45.000Z","updated_at":"2025-05-14T16:47:10.000Z","dependencies_parsed_at":"2023-07-05T16:15:23.918Z","dependency_job_id":null,"html_url":"https://github.com/th0r/npm-upgrade","commit_stats":{"total_commits":129,"total_committers":12,"mean_commits":10.75,"dds":0.2325581395348837,"last_synced_commit":"173c16e244ec7aa69a21ea354085138009150266"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Fnpm-upgrade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Fnpm-upgrade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Fnpm-upgrade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/th0r%2Fnpm-upgrade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/th0r","download_url":"https://codeload.github.com/th0r/npm-upgrade/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573589,"owners_count":22093731,"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":["changelog","cli","deps","interactive","npm","outdated","packages","update","upgrade"],"created_at":"2024-07-31T17:01:09.928Z","updated_at":"2025-05-16T17:08:23.175Z","avatar_url":"https://github.com/th0r.png","language":"JavaScript","funding_links":[],"categories":["Packages","JavaScript"],"sub_categories":["Other"],"readme":"# npm-upgrade\nInteractive CLI utility to easily update outdated NPM dependencies with changelogs inspection support.\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url]\n\n## What is this for?\nIf you are tired of manually upgrading `package.json` every time your package dependencies are getting out of date then this utility is for you.\n\nTake a look at this demo:\n\n![npm-upgrade outdated packages](https://cloud.githubusercontent.com/assets/302213/11168821/08311b90-8bb2-11e5-9a71-5da73682ed44.gif)\n\n## Installation\nFirst, install [Node.js](https://nodejs.org) (at least `v10.19`).\n\nThen install this utility as global npm-module:\n```sh\nnpm i -g npm-upgrade\n```\n\n## Usage\nThis utility is supposed to be run in the root directory of your Node.js project (that contains `package.json`).\nRun `npm-upgrade --help` to see all available top-level commands:\n```\ncheck [filter]          Check for outdated modules\nignore \u003ccommand\u003e        Manage ignored modules\nchangelog \u003cmoduleName\u003e  Show changelog for a module\n```\nRun `npm-upgrade \u003ccommand\u003e --help` to see usage help for corresponding command.\n`check` is the default command and can be omitted so running `npm-upgrade [filter]` is the same as `npm-upgrade check [filter]`.\n\n### `check` command\nIt will find all your outdated deps and will ask to updated their versions in `package.json`, one by one.\nFor example, here is what you will see if you use outdated version of `@angular/common` module:\n```\nUpdate \"@angular/common\" in package.json from 2.4.8 to 2.4.10? (Use arrow keys)\n❯ Yes\n  No\n  Show changelog\n  Ignore\n  Finish update process\n```\n* `Yes` will update `@angular/common` version in `package.json` to `2.4.10`, but not immediately (see explanation below)\n* `No` will not update this module version.\n* `Show changelog` will try to find changelog url for the current module and open it in default browser.\n* `Ignore` will add this module to the ignored list (see details in [`Ignoring module`](#ignoring-module) section below).\n* `Finish update process` will ...hm... finish update process and save all the changes to `package.json`.\n\nA note on saving changes to `package.json`: when you choose `Yes` to update some module's version, `package.json` won't be immediately updated. It will be updated only after you will process all the outdated modules and confirm update **or** when you choose `Finish update process`. So if in the middle of the update process you've changed your mind just press `Ctrl+C` and `package.json` will remain untouched.\n\nIf you want to check only some deps, you can use `filter` argument:\n```sh\n# Will check only `babel-core` module:\nnpm-upgrade babel-core\n\n# Will check all the deps with `babel` in the name:\nnpm-upgrade '*babel*'\n\n# Note quotes around `filter`. They are necessary because without them bash may interpret `*` as wildcard character.\n\n# Will check all the deps, excluding any with `babel` in the name:\nnpm-upgrade '!*babel*'\n\n# You can combine including and excluding rules:\nnpm-upgrade '*babel* !babel-transform-* !babel-preset-*'\n```\n\nIf you want to check only a group of deps use these options:\n```\n-p, --production   Check only \"dependencies\"\n-d, --development  Check only \"devDependencies\"\n-o, --optional     Check only \"optionalDependencies\"\n```\n\nAlternatively, you can use the `-g` (`--global`) flag to upgrade your global packages. **Note** that this flag is mutually exclusive and `npm-upgrade` will only recognise the global flag if supplied with others. Also **Note** that this option will automatically attempt to upgrade your global packages using `npm install -g \u003cpackage\u003e@\u003cnew-version\u003e`.\n\n#### Ignoring module\nSometimes you just want to ignore newer versions of some dependency for some reason. For example, you use `jquery v2` because of the old IE support and don't want `npm-upgrade` to suggest you updating it to `v3`. Or you use `some-funky-module@6.6.5` and know that the new version `6.6.6` contains a bug that breaks your app.\n\nYou can handle these situations by ignoring such modules. You can do it in two ways: choosing `Ignore` during update process or using `npm ignore add` command.\n\nYou will asked two questions. First is a version range to ignore. It should be a valid [semver](http://semver.org/) version. Here are a few examples:\n* `6.6.6` - will ignore only version `6.6.6`. When the next version after `6.6.6` will be published `npm-upgrade` will suggest to update it. Can be used in `some-funky-module` example above.\n* `\u003e2` - will ignore all versions starting from `3.0.0`. Can be used in `jquery v2` example above.\n* `6.6.x || 6.7.x` - will ignore all `6.6.x` and `6.7.x` versions.\n* `*` - will ignore all new versions.\n\nAnd after that `npm-upgrade` will ask about the ignore reason. The answer is optional but is strongly recommended because it will help to explain your motivation to your сolleagues and to yourself after a few months.\n\nAll the data about ignored modules will be stored in `.npm-upgrade.json` file next to your project's `package.json`.\n\n### `ignore` command\nIt will help you manage ignored modules. See [Ignoring module](#ignoring-module) section for more details.\nIt has the following subcommands:\n```\nnpm-upgrade ignore \u003ccommand\u003e\n\nCommands:\n  add [module]        Add module to ignored list\n  list                Show the list of ignored modules\n  reset [modules...]  Reset ignored modules\n```\n* `add` - will add a module from your deps to ignored list. You can either provide module name as optional `module` argument or interactively select it from the list of project's deps.\n* `list` - will show the list of currently ignored modules along with their ignored versions and reasons.\n* `reset` - will remove modules from the ignored list. You can either provide module names as `modules` argument (separated by space) or interactively select them from the list of project's deps.\n\n### `changelog` command\n```\nnpm-upgrade changelog \u003cmoduleName\u003e\n```\nWill try to find changelog url for provided module and open it in default browser.\n\n## Troubleshooting\n**Wrong changelog shown for _\\\u003cmoduleName\\\u003e_ or not shown at all!**\n\nYes, It can happen sometimes. This is because there is no standardized way to specify changelog location for the module, so it tries to guess it, using these rules one by one:\n\n1. Check `db/changelogUrls.json` from `master` branch on GitHub or the local copy if it's unreachable.\n2. Check `changelog` field from module's `package.json`.\n3. Parse module's `repository.url` field and if it's on GitHub or GitLab, try to request some common changelog files (`CHANGELOG.md`, `History.md` etc.) from main branch and if it fails, open `Releases` page.\n\nSo, if it guessed wrong it would be great if you could either [fill an issue](../../issues/new) about this or submit a PR which adds proper changelog URL to `db/changelogUrls.json`. There is a tool in the repository for you to make it as easy as possible:\n```sh\n./tools/addModuleChangelogUrlToDb.js \u003cmoduleName\u003e \u003cchangelogUrl\u003e\n```\n\n## License\n\n[MIT](LICENSE)\n\n[downloads-image]: https://img.shields.io/npm/dt/npm-upgrade.svg\n[npm-url]: https://www.npmjs.com/package/npm-upgrade\n[npm-image]: https://img.shields.io/npm/v/npm-upgrade.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth0r%2Fnpm-upgrade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fth0r%2Fnpm-upgrade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fth0r%2Fnpm-upgrade/lists"}