downloads
Across all versions.
Download trend unavailable.
compatibility
Runtime metadata.
nodeany
cjs
keywords
Tagged topics.
aliasnodenode versionsversionsltsactivemaintenence
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 30 packages.
2.8 MB
Includes dependencies.
This repository is managed by the Package Maintenance Working Group, see Governance.
$ npm i @pkgjs/nv$ npx @pkgjs/nv --help
nv <command>
Commands:
nv ls [versions...] List Node.js versions [aliases: show]
Options:
--help Show help [boolean]
--version Show version number [boolean]
$ npx @pkgjs/nv ls --help
nv ls [versions...]
List Node.js versions
Options:
--help Show help [boolean]
--version Show version number [boolean]
--mirror mirror url to load from
[string] [default: https://nodejs.org/dist/]
--pretty-json Pretty print json
[string] [default: pretty print json spaces, default 2 (--no-pretty-json for
new line delimted json)]
--latest-of-major-only Only show latest version in each semver major range
[boolean] [default: false]
--versions [default: "lts_active"]const nv = require('@pkgjs/nv')
(async () => {
const versions = await nv('lts')
console.log(versions)
/*
[
{
"version": "18.18.2",
"major": 18,
"minor": 18,
"patch": 2,
"tag": "",
"codename": "hydrogen",
"versionName": "v18",
"start": "2022-04-19T00:00:00.000Z",
"lts": "2022-10-25T00:00:00.000Z",
"maintenance": "2023-10-18T00:00:00.000Z",
"end": "2025-04-30T00:00:00.000Z",
"releaseDate": "2023-10-13T00:00:00.000Z",
"isLts": true,
"files": [
"aix-ppc64",
You can also pass an array of aliases and the resulting array will be sorted and de-duped, for example:
const versions = await nv(['lts', 'supported'])
console.log(versions.map((v) => v.version))
/*
[ '8.16.1', '10.16.3', '12.11.0' ]
*/Support Aliases
For now referenced here until we have a more official doc: https://github.com/nodejs/package-maintenance/issues/236#issue-474783582
all: All node versionslts_active: Head of LTS and Active major version lineslts: Head of current LTS linesactive: The newest version in the active but not maintenance mode lineslts_latest/lts/*: Latest of the LTS lines (lts/* for nvm compatibility)supported: Head of all maintained linesmaintained: Head of all maintained linescurrent/node: Newest of all maintained lines (node for nvm compatibility)Version Aliases
v6, v8, v10, v12, etc: Head of major version line by version numberdubnium, carbon: Named alias for LTS linesnodejs-foundation
build@iojs.org