node-versions-info
v2.0.0
Published
Get active Node.js LTS and current version numbers
Maintainers
Readme
node-versions-info
Get Node.js release info as structured data — one field per question, so you can wire it straight into CI matrices, Dockerfiles, or AI tooling.
Usage
CLI via npx
npx node-versions-infoOutput:
{
"lts": 24,
"activeLts": [22, 24],
"maintenanceLts": [20],
"current": 25,
"supported": [20, 22, 24, 25],
"next": 26
}| Field | Answers | Typical use |
|------------------|-------------------------------------------|----------------------------------------------------|
| lts | Which single version should I target? | FROM node:{lts}, AI tool defaults, docs |
| activeLts | What should I test in CI? | GitHub Actions node-version matrix |
| maintenanceLts | Which LTS lines are winding down? | Deprecation notices, security advisories |
| current | What's the newest release line? | Bleeding-edge testing |
| supported | What still receives any updates at all? | Minimum-support matrices, fallback lists |
| next | What major is coming next? | Pre-flight CI, release planning |
Every major falls into exactly one of activeLts, maintenanceLts, current (non-LTS) or next — the sets don't overlap. supported is the union of the first three. lts equals max(activeLts).
Library
npm install node-versions-infoimport { getNodeVersions } from 'node-versions-info';
const v = await getNodeVersions();
console.log(v.lts); // 24
console.log(v.activeLts); // [22, 24]
console.log(v.maintenanceLts); // [20]
console.log(v.current); // 25
console.log(v.supported); // [20, 22, 24, 25]
console.log(v.next); // 26GitHub Actions matrix
- id: node
run: echo "matrix=$(npx -y node-versions-info | jq -c .activeLts)" >> $GITHUB_OUTPUT
test:
strategy:
matrix:
node: ${{ fromJson(needs.node.outputs.matrix) }}Data source
Version data is fetched from the official Node.js Release Working Group schedule:
https://raw.githubusercontent.com/nodejs/Release/main/schedule.jsonLicense
Made with ❤️ by Roman Ožana
