JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24
  • Score
    100M100P100Q68434F
  • License BSD-3-Clause

Get the maintained LTS versions of Node.js

Package Exports

  • node-lts-versions
  • node-lts-versions/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-lts-versions) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

CI Conventional Commits

Node.js LTS versions

Retrieve a list of Release versions of Node.js and export the versions for consumption by automated processes.

The output of the yaml function is designed to populate a GitHub Actions matrix declaration so that your CI is testing with the supported LTS version(s) of Node.js.

Usage

This action has the following outputs:

  • active are Active LTS versions
  • maintenance are Maintenance LTS versions
  • lts is all LTS versions (active + maintenance)
  • current is the Current node version
  • min is the lowest LTS version

At the time of writing, active=[22] and lts=[18,20,22].

manually (the normal way)

test:
  strategy:
    matrix:
      os: [ubuntu-latest, windows-latest, macos-latest]
      node-version: [18, 20]
    fail-fast: false
  steps:

automatically

test:
  needs: get-lts
  strategy:
    matrix:
      os: [ubuntu-latest, windows-latest, macos-latest]
      node-version: ${{ fromJson(needs.get-lts.outputs.lts) }}
    fail-fast: false
  steps:
get-lts:
  runs-on: ubuntu-latest
  steps:
    - id: get
      uses: msimerson/node-lts-versions@v1
  outputs:
    active: ${{ steps.get.outputs.active }}
    lts: ${{ steps.get.outputs.lts }}
    min: ${{ steps.get.outputs.min }}

Example

node main.js
::set-output name=active::["22"]
::set-output name=maintenance::["18","20"]
::set-output name=lts::["18","20","22"]
::set-output name=current::["23"]
::set-output name=min::"18"

RAW

const ltsv = require('node-lts-versions')
ltsv.fetchLTS().then(() => {
  console.log(ltsv.json())
  console.log(ltsv.yaml())
  ltsv.print()
})

Methods

fetchLTS

Retrieves Node.js version information.

json

Display Node.js version information in JSON format.

> ltsv.json('active')
'["22"]'
> ltsv.json('lts')
'["18","20","22"]'
> ltsv.json()
'["23"]'

yaml

Display Node.js version information in YAML format.

> ltsv.yaml('lts')
[ '18', '20', '22' ]
> ltsv.yaml('active')
[ '22' ]
> ltsv.yaml('maintenance')
[ '18', '20' ]
> ltsv.yaml('current')
[ '23' ]

print

Display Node.js version information in tabular format.

Ver Codename    Latest Release          LTS Period
18    Hydrogen  v18.20.8 on 2025-03-27  2022-10-17 to 2025-04-17
20    Iron      v20.19.0 on 2025-03-13  2023-10-16 to 2026-04-16
22    Jod       v22.14.0 on 2025-02-11  2024-10-23 to 2027-04-23

Reference

Future

Got ideas? Contributions are welcome. Submit a PR with tests and it will likely be accepted.