{"id":15007688,"url":"https://github.com/ehmicky/normalize-node-version","last_synced_at":"2025-06-11T20:06:17.883Z","repository":{"id":39822028,"uuid":"201261179","full_name":"ehmicky/normalize-node-version","owner":"ehmicky","description":"Normalize and validate Node.js versions","archived":false,"fork":false,"pushed_at":"2024-09-14T16:52:57.000Z","size":10822,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-28T15:21:07.926Z","etag":null,"topics":["bash","cli","command-line","dependency-management","es6","exec","javascript","library","node","nodejs","npmjs","npx","nvm","operating-system","package-manager","shell","terminal","typescript","versioning","versions"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ehmicky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-08-08T13:11:46.000Z","updated_at":"2024-09-14T16:53:00.000Z","dependencies_parsed_at":"2024-04-22T20:27:42.822Z","dependency_job_id":"ab857b4e-eeab-45bb-9d7d-ff244e2e633c","html_url":"https://github.com/ehmicky/normalize-node-version","commit_stats":{"total_commits":746,"total_committers":4,"mean_commits":186.5,"dds":"0.018766756032171594","last_synced_commit":"e9dd51ef4217590bfd9b6dcfcd2659be3b0d23a5"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fnormalize-node-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fnormalize-node-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fnormalize-node-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ehmicky%2Fnormalize-node-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ehmicky","download_url":"https://codeload.github.com/ehmicky/normalize-node-version/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219856362,"owners_count":16556084,"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":["bash","cli","command-line","dependency-management","es6","exec","javascript","library","node","nodejs","npmjs","npx","nvm","operating-system","package-manager","shell","terminal","typescript","versioning","versions"],"created_at":"2024-09-24T19:13:25.793Z","updated_at":"2025-06-11T20:06:17.877Z","avatar_url":"https://github.com/ehmicky.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Node](https://img.shields.io/badge/-Node.js-808080?logo=node.js\u0026colorA=404040\u0026logoColor=66cc33)](https://www.npmjs.com/package/normalize-node-version)\n[![TypeScript](https://img.shields.io/badge/-Typed-808080?logo=typescript\u0026colorA=404040\u0026logoColor=0096ff)](/src/main.d.ts)\n[![Codecov](https://img.shields.io/badge/-Tested%20100%25-808080?logo=codecov\u0026colorA=404040)](https://codecov.io/gh/ehmicky/normalize-node-version)\n[![Mastodon](https://img.shields.io/badge/-Mastodon-808080.svg?logo=mastodon\u0026colorA=404040\u0026logoColor=9590F9)](https://fosstodon.org/@ehmicky)\n[![Medium](https://img.shields.io/badge/-Medium-808080.svg?logo=medium\u0026colorA=404040)](https://medium.com/@ehmicky)\n\nNormalize and validate Node.js versions.\n\nTakes any version range as inputs such as `8`, `8.5.0` or `\u003e=8` and returns a\n`\"major.minor.patch\"` string. Throws if the Node.js version does not exist.\n\n# Example\n\n```js\nimport normalizeNodeVersion from 'normalize-node-version'\n\nawait normalizeNodeVersion('8') // '8.17.0'\nawait normalizeNodeVersion('8.5.0') // '8.5.0'\nawait normalizeNodeVersion('v8.5.0') // '8.5.0'\nawait normalizeNodeVersion('\u003c7') // '6.17.1'\nawait normalizeNodeVersion('8.5.2') // Error: Invalid Node version\nawait normalizeNodeVersion('not_a_version') // Error: Invalid Node version\n\n// All available options\nawait normalizeNodeVersion('8', {\n  // Use a mirror for Node.js binaries\n  mirror: 'https://npmmirror.com/mirrors/node',\n  // Do not cache the list of available Node.js versions\n  fetch: true,\n  // Cancels when the signal is aborted\n  signal: new AbortController().signal,\n})\n```\n\n# Install\n\n```bash\nnpm install normalize-node-version\n```\n\nThis package works in Node.js \u003e=18.18.0.\n\nThis is an ES module. It must be loaded using\n[an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c),\nnot `require()`. If TypeScript is used, it must be configured to\n[output ES modules](https://www.typescriptlang.org/docs/handbook/esm-node.html),\nnot CommonJS.\n\n# Usage\n\n## normalizeNodeVersion(versionRange, options?)\n\n`versionRange`: `string`\\\n`options`: `object?`\\\n_Returns_: `Promise\u003cstring\u003e`\n\n### options\n\n#### mirror\n\n_Type_: `string`\\\n_Default_: `https://nodejs.org/dist`\n\nBase URL to fetch the list of available Node.js versions. Can be customized (for\nexample `https://npmmirror.com/mirrors/node`).\n\nThe following environment variables can also be used: `NODE_MIRROR`,\n`NVM_NODEJS_ORG_MIRROR`, `N_NODE_MIRROR` or `NODIST_NODE_MIRROR`.\n\n#### fetch\n\n_Type_: `boolean`\\\n_Default_: `undefined`\n\nThe list of available Node.js versions is cached for one hour by default. If the\n`fetch` option is:\n\n- `true`: the cache will not be used\n- `false`: the cache will be used even if it's older than one hour\n\n#### signal\n\n_Type_:\n[`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)\n\nCancels when the signal is aborted.\n\n# See also\n\n- [`nve`](https://github.com/ehmicky/nve): Run a specific Node.js version (CLI)\n- [`nvexeca`](https://github.com/ehmicky/nve): Run a specific Node.js version\n  (programmatic)\n- [`get-node`](https://github.com/ehmicky/get-node): Download Node.js\n- [`preferred-node-version`](https://github.com/ehmicky/preferred-node-version):\n  Get the preferred Node.js version of a project or user\n- [`node-version-alias`](https://github.com/ehmicky/node-version-alias): Resolve\n  Node.js version aliases like `latest`, `lts` or `erbium`\n- [`all-node-versions`](https://github.com/ehmicky/all-node-versions): List all\n  available Node.js versions\n- [`fetch-node-website`](https://github.com/ehmicky/fetch-node-website): Fetch\n  releases on nodejs.org\n\n# Support\n\nFor any question, _don't hesitate_ to [submit an issue on GitHub](../../issues).\n\nEveryone is welcome regardless of personal background. We enforce a\n[Code of conduct](CODE_OF_CONDUCT.md) in order to promote a positive and\ninclusive environment.\n\n# Contributing\n\nThis project was made with ❤️. The simplest way to give back is by starring and\nsharing it online.\n\nIf the documentation is unclear or has a typo, please click on the page's `Edit`\nbutton (pencil icon) and suggest a correction.\n\nIf you would like to help us fix a bug or add a new feature, please check our\n[guidelines](CONTRIBUTING.md). Pull requests are welcome!\n\nThanks go to our wonderful contributors:\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://fosstodon.org/@ehmicky\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/8136211?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eehmicky\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ehmicky/normalize-node-version/commits?author=ehmicky\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#design-ehmicky\" title=\"Design\"\u003e🎨\u003c/a\u003e \u003ca href=\"#ideas-ehmicky\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/ehmicky/normalize-node-version/commits?author=ehmicky\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://twitter.com/adrieankhisbe\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/2601132?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAdrien Becchis\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/ehmicky/normalize-node-version/commits?author=AdrieanKhisbe\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/ehmicky/normalize-node-version/commits?author=AdrieanKhisbe\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#ideas-AdrieanKhisbe\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://maxim.mazurok.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7756211?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMaxim Mazurok\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-Maxim-Mazurok\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehmicky%2Fnormalize-node-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fehmicky%2Fnormalize-node-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fehmicky%2Fnormalize-node-version/lists"}