# @pkgjs/nv

> A tool for resolving node versions from common aliases

Latest version **0.3.0** (published 2025-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pkgjs/nv
pnpm add @pkgjs/nv
yarn add @pkgjs/nv
bun add @pkgjs/nv
```

Provides the command `nv`.

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2025-09-18 |
| First published | 2019-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 29.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 25 |
| Author | Wes Todd |
| Maintainers | wesleytodd, nodejs-foundation |
| Keywords | alias, node, node versions, versions, lts, active, maintenance |

## Links

- npm: https://www.npmjs.com/package/@pkgjs/nv
- Repository: https://github.com/pkgjs/nv
- Homepage: https://github.com/pkgjs/nv#readme
- Issues: https://github.com/pkgjs/nv/issues
- npm.io page: https://npm.io/package/@pkgjs/nv

## Dependencies (3)

- [got](https://npm.io/package/got.md) ^11.8.6
- [yargs](https://npm.io/package/yargs.md) ^16.2.0
- [semver](https://npm.io/package/semver.md) ^7.1.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2025-09-18
- 0.2.2 — 2023-10-19
- 0.2.1 — 2022-01-20
- 0.2.1-0 — 2022-01-20
- 0.2.0 — 2021-12-01
- 0.1.0 — 2020-08-28
- 0.0.3 — 2020-01-03
- 0.0.2 — 2020-01-03
- 0.0.1 — 2019-09-27

## README

# Get information about Node.js versions

[![NPM Version](https://img.shields.io/npm/v/@pkgjs/nv.svg)](https://npmjs.org/package/@pkgjs/nv)
[![NPM Downloads](https://img.shields.io/npm/dm/@pkgjs/nv.svg)](https://npmjs.org/package/@pkgjs/nv)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard)
[![CI Test](https://github.com/pkgjs/nv/workflows/Test/badge.svg)](https://github.com/pkgjs/nv/actions)

This repository is managed by the [Package Maintenance Working Group](https://github.com/nodejs/package-maintenance), see [Governance](https://github.com/nodejs/package-maintenance/blob/master/Governance.md).

## Usage

```
$ 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"]
```

```javascript
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",
      "headers",
      "linux-arm64",
      "linux-armv7l",
      "linux-ppc64le",
      "linux-s390x",
      "linux-x64",
      "osx-arm64-tar",
      "osx-x64-pkg",
      "osx-x64-tar",
      "src",
      "win-x64-7z",
      "win-x64-exe",
      "win-x64-msi",
      "win-x64-zip",
      "win-x86-7z",
      "win-x86-exe",
      "win-x86-msi",
      "win-x86-zip"
    ],
    "dependencies": {
      "npm": "9.8.1",
      "v8": "10.2.154.26",
      "uv": "1.44.2",
      "zlib": "1.2.13.1-motley",
      "openssl": "3.0.10+quic"
    }
  }
]
  */
})()
```

You can also pass an array of aliases and the resulting array will be sorted and de-duped, for example:

```javascript
const versions = await nv(['lts', 'supported'])
console.log(versions.map((v) => v.version))
/*
[ '8.16.1', '10.16.3', '12.11.0' ]
*/
```

## Supported Aliases

**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 versions
- `lts_active`: Head of LTS and Active major version lines
- `lts`: Head of current LTS lines
- `active`: The newest version in the active but not maintenance mode lines
- `lts_latest`/`lts/*`: Latest of the LTS lines (`lts/*` for nvm compatibility)
- `supported`: Head of all maintained lines
- *DEPRECATED* `maintained`: Head of all maintained lines
- `current`/`node`: Newest of all maintained lines (`node` for nvm compatibility)

**Version Aliases**

- `v6`, `v8`, `v10`, `v12`, etc: Head of major version line by version number
- `dubnium`, `carbon`: Named alias for LTS lines

---
_Source: https://npm.io/package/@pkgjs/nv · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
