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 Long Term Stable versions of Node.js.

The output of the yaml function is designed to populate a GitHub Actions matrix declaration so that your CI is always testing with every Active LTS version of Node.js.

Usage

This action has two outputs: active and lts.

  • active is currently active node.js versions
  • lts is a subset of active versions.
  • min is the lowest LTS version

At the time of writing, active=[14,16,18] and lts=[14,16]. Node.js v18 is due to start LTS in five more months.

manually (the normal way)

  test:
    strategy:
      matrix:
        os: [ ubuntu-latest, windows-latest, macos-latest ]
        node-version: [ 12, 14, 16 ]
      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.2.0
    outputs:
      active: ${{ steps.get.outputs.active }}
      lts: ${{ steps.get.outputs.lts }}
      min: ${{ steps.get.outputs.min }}

Example

node main.js
::set-output name=active::["14","16","18"] name=lts::["14","16"] name=min::"14"

RAW

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

Methods

fetch

Retrieves Node.js version information. Prints active LTS versions in several formats.

json

["14","16"]

yaml

[ '14', '16' ]

print

> Ver Codename  Latest Release      LTS Period
14  Fermium v14.19.3  2022-05-17    2020-10-27 to 2023-04-26
16  Gallium v16.15.0  2022-04-26    2021-10-26 to 2024-04-25

Reference

Future

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