{"id":21925542,"url":"https://github.com/jelmerro/nus","last_synced_at":"2025-10-25T16:13:56.139Z","repository":{"id":238024343,"uuid":"795707866","full_name":"Jelmerro/nus","owner":"Jelmerro","description":"Node/npm Update Script - A script to update all node/npm packages in a project.","archived":false,"fork":false,"pushed_at":"2025-01-10T16:27:56.000Z","size":135,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T09:33:52.061Z","etag":null,"topics":["dependency-manager","nodejs","npm","update","updater","updater-script"],"latest_commit_sha":null,"homepage":"","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/Jelmerro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"ko_fi":"jelmerro","github":"jelmerro"}},"created_at":"2024-05-03T21:26:30.000Z","updated_at":"2025-01-10T16:27:59.000Z","dependencies_parsed_at":"2024-08-26T23:06:35.490Z","dependency_job_id":null,"html_url":"https://github.com/Jelmerro/nus","commit_stats":null,"previous_names":["jelmerro/nus"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jelmerro%2Fnus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jelmerro%2Fnus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jelmerro%2Fnus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jelmerro%2Fnus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jelmerro","download_url":"https://codeload.github.com/Jelmerro/nus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249730392,"owners_count":21317291,"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":["dependency-manager","nodejs","npm","update","updater","updater-script"],"created_at":"2024-11-28T21:19:10.163Z","updated_at":"2025-10-25T16:13:51.113Z","avatar_url":"https://github.com/Jelmerro.png","language":"JavaScript","funding_links":["https://ko-fi.com/jelmerro","https://github.com/sponsors/jelmerro"],"categories":[],"sub_categories":[],"readme":"nus\n===\n\nNode/npm Update Script - A script to update all node/npm packages in a project.\n\n## Features\n\n- Always update to the latest including major (unless overridden using [semver ranges](https://github.com/npm/node-semver))\n- Always do a clean install to update nested dependencies too\n- Specify custom versions to use by tag, range or version (default is latest)\n- Single command to update, install, audit and finally dedup\n- Custom save-prefix, npm install options (force/legacy-peer-deps) and indent\n- Exact versions in package.json to avoid confusion and surprises\n- Clean CLI output: name, old version, new version \u0026 update policy (in brackets)\n\n## Usage\n\n### Run once\n\n`npx -y jelmerro/nus`\n\n### Add to scripts\n\n```json\n{\n    \"scripts\": {\n        \"update\": \"npx -y jelmerro/nus\"\n    }\n}\n```\n\nThen simply run `npm run update` to update everything.\nIn short, this will find the right versions for each package in the `package.json`,\nthen change the versions in this file, delete `package-lock.json` and `node_modules`,\nfinally install the packages from scratch based on the updated `package.json` file.\nThe overrides are the main way to change package versions using nus if needed,\nso see below for all information about configuring it using the config file.\n\n## Config\n\nThere is an `nus.config.js` that you can store inside the root of your repo.\nThis file can hold all nus config and even overrides for versions to use.\nA basic config (using all default settings) can look like this:\n\n`nus.config.js`\n\n```js\nexport default {\n    \"audit\": true,\n    \"dedup\": true,\n    \"indent\": 4,\n    \"npm\": {\n        \"force\": false,\n        \"global\": false,\n        \"ignoreScripts\": false,\n        \"legacy\": false,\n        \"silent\": false,\n        \"verbose\": false\n    },\n    \"overrides\": {},\n    \"prefixChar\": \"\"\n}\n```\n\nThe audit and dedup options are for running respective npm commands after `npm ci`.\nThe indent option is the indent level in spaces (or literally `\"\\t\"`) for the package.json.\nIf unset, the package.json's current indent level (or tabs) are checked and re-used,\nso in practice you should rarely need to set this explicitly.\nThe same is true for and boolean options that are already set to the value you need.\nThe npm subkey is used for giving the respective options to npm commands,\nthe one that is always run is `npm install`, but by default `audit` and `dedup` are also run.\nThey all use the same npm arguments, by default none, to install/audit/dedup the packages.\nYou can also change the prefixChar option to add a char in front of versions,\nsuch as \"~\" for only patch upgrades and \"^\" for any non-major ones.\nThis character is added only to the package.json, mostly as a suggestion,\nas you should rarely if ever run a plain `npm i` instead of `npm ci`,\nhence why by default it is left empty to specify the exact version.\nCommonJS's `module.exports` syntax will also work if you have not set `\"type\": \"module\"` yet.\n\n### Overrides\n\nInside the `nus.config.js` file you can specify a string-string object of versions.\nThis object is used to change specific packages from using a different version than latest.\nThis can be done by listing an exact version, a dist-tag or a semver range.\nFor example, to use the latest beta tag of package `package-a`,\nas well as the newest v5.x.x major release of `package-b` (but not 6.0.0 or newer),\nyou should use an overrides section like so:\n\n```json\n{\n    \"package-a\": \"beta\",\n    \"package-b\": \"^5\"\n}\n```\n\nYou can also list versions directly, but tags and [semver ranges](https://github.com/npm/node-semver#ranges) are recommended.\nIf you only want to change the overrides and not any config,\nyou can also use `nus.overrides.json` in the root of your project.\nThis file does not support any other config, but just the overrides object like above.\nYou are free to have both a config and an overrides file,\nbut if you have the same package name in both files the overrides file has priority.\nDirect source urls (such as those starting with `http:`/`https:`) or file dependencies are always skipped.\nAliased packages, such as `\"custom-package\": \"npm:package@version\"`, are by default updated to latest,\neven if `package` is overridden, but can be overridden separately by using the `custom-package` name instead.\n\n#### Git overrides\n\nIn case of git(hub) packages, you can supply a commit-ish argument,\nwhich means any tag, sha hash, or branch which can be supplied as an argument to `git checkout`.\nFor example, `#1.0.0`, `#c1f134d` or `#master` are all valid, the `#` is optional in the nus config,\nbut you might want to list it with the `#` to be explicit about git package overrides.\nUnlike npm semver ranges and versions, these are not checked for validity before installing,\nso unlike invalid semver ranges, supplying an invalid git override will prevent `npm install` from working.\n\n## License\n\nnus was ported from an old python script I always copied and used to update with.\nI have licensed the original script under various licenses, either GPL3 or MIT.\nSince the current JS iteration is a complete rewrite, I decided to go plain MIT.\nYou can see the LICENSE file for exact terms and conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjelmerro%2Fnus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjelmerro%2Fnus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjelmerro%2Fnus/lists"}