{"id":17109685,"url":"https://github.com/msimerson/node-lts-versions","last_synced_at":"2026-04-02T13:14:10.294Z","repository":{"id":38379863,"uuid":"336196554","full_name":"msimerson/node-lts-versions","owner":"msimerson","description":"Get Node.js LTS versions","archived":false,"fork":false,"pushed_at":"2024-04-04T20:59:32.000Z","size":172,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-17T10:49:45.659Z","etag":null,"topics":["continuous-integration","nodejs","testing-tools"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/node-lts-versions","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msimerson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-02-05T07:26:44.000Z","updated_at":"2024-02-08T06:25:07.000Z","dependencies_parsed_at":"2023-01-04T14:06:52.771Z","dependency_job_id":"968a4d06-4ccf-4ef0-8d3b-b049fea6af67","html_url":"https://github.com/msimerson/node-lts-versions","commit_stats":{"total_commits":21,"total_committers":1,"mean_commits":21.0,"dds":0.0,"last_synced_commit":"416a9e5ba906ccc82b7267c177071c0e7cdf074c"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msimerson%2Fnode-lts-versions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msimerson%2Fnode-lts-versions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msimerson%2Fnode-lts-versions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msimerson%2Fnode-lts-versions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msimerson","download_url":"https://codeload.github.com/msimerson/node-lts-versions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227458346,"owners_count":17778093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["continuous-integration","nodejs","testing-tools"],"created_at":"2024-10-14T16:24:03.009Z","updated_at":"2026-04-02T13:14:10.289Z","avatar_url":"https://github.com/msimerson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/msimerson/node-lts-versions/actions/workflows/ci.yml/badge.svg)](https://github.com/msimerson/node-lts-versions/actions/workflows/ci.yml)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits\u0026logoColor=white)](https://conventionalcommits.org)\n\n# Node.js versions\n\nAvoid needing to update your CI config files for every Node.js release or EOL event.\n\nThis action retrieves a list of Node.js [release](https://nodejs.org/en/about/previous-releases) versions and exports the versions for consumption by automated processes.\n\nThe output of the yaml function is designed to populate a GitHub Actions matrix declaration so that your CI is testing with the version(s) of Node.js you choose, typically the **LTS** version(s).\n\n### Usage\n\nThis action has the following outputs:\n\n- `active` are Active LTS versions\n- `maintenance` are Maintenance LTS versions\n- `lts` is all LTS versions (active + maintenance)\n- `current` is the Current node version\n- `min` is the lowest LTS version\n\n#### active\n\nThe currently active Node.js version. This is like a baton that is handed from one version of Node.js to the next.\n\n#### maintenance\n\nEvery version of Node.js that is actively maintained by the Node.js project.\n\n#### lts\n\nSimilar to maintenance, except it excludes odd number releases that are never considered Long Term Stable. This is the target most modules should use in their CI tests.\n\n#### current\n\nThe `current` version would usually be used in your CI tests to always tests your code against the latest Node.js version, but perhaps without failing the CI tests.\n\n#### min\n\nThe `min` version is the lowest supported version of Node.js. It couple be used for modules with scarce updates, whose SLA is a best effort to support _any_ version of Node.js.\n\n#### manually (the normal way)\n\n```yaml\ntest:\n  strategy:\n    matrix:\n      os: [ubuntu-latest, windows-latest, macos-latest]\n      node-version: [20, 22]\n    fail-fast: false\n  steps:\n```\n\n#### automatically\n\n```yaml\ntest:\n  needs: get-lts\n  strategy:\n    matrix:\n      os: [ubuntu-latest, windows-latest, macos-latest]\n      node-version: ${{ fromJson(needs.get-lts.outputs.lts) }}\n    fail-fast: false\n  steps:\nget-lts:\n  runs-on: ubuntu-latest\n  steps:\n    - id: get\n      uses: msimerson/node-lts-versions@v1\n  outputs:\n    active: ${{ steps.get.outputs.active }}\n    maintenance: ${{ steps.get.outputs.maintenance }}\n    lts: ${{ steps.get.outputs.lts }}\n    current: ${{ steps.get.outputs.current }}\n    min: ${{ steps.get.outputs.min }}\n```\n\n### Example\n\n```sh\n✗ node main.js\n::set-output name=active::[\"22\"]\n::set-output name=maintenance::[\"18\",\"20\"]\n::set-output name=lts::[\"18\",\"20\",\"22\"]\n::set-output name=current::[\"23\"]\n::set-output name=min::\"18\"\n```\n\n#### RAW\n\n```js\nconst ltsv = require('node-lts-versions')\nltsv.fetchLTS().then(() =\u003e {\n  console.log(ltsv.json())\n  console.log(ltsv.yaml())\n  ltsv.print()\n})\n```\n\nor\n\n```js\nconst { getNodeLTS } = require('node-lts-versions')\nconst ltsv = new getNodeLTS()\nltsv.fetchLTS().then(() =\u003e {\n  console.log(ltsv.json())\n  console.log(ltsv.yaml())\n  ltsv.print()\n})\n```\n\n### Methods\n\n#### fetchLTS\n\nRetrieves Node.js version information.\n\n#### json\n\nDisplay Node.js version information in JSON format.\n\n```js\n\u003e ltsv.json('active')\n'[\"22\"]'\n\u003e ltsv.json('lts')\n'[\"18\",\"20\",\"22\"]'\n\u003e ltsv.json()\n'[\"23\"]'\n```\n\n#### yaml\n\nDisplay Node.js version information in YAML format.\n\n```js\n\u003e ltsv.yaml('lts')\n[ '18', '20', '22' ]\n\u003e ltsv.yaml('active')\n[ '22' ]\n\u003e ltsv.yaml('maintenance')\n[ '18', '20' ]\n\u003e ltsv.yaml('current')\n[ '23' ]\n```\n\n#### print\n\nDisplay Node.js version information in tabular format.\n\n```\nVer Codename    Latest Release          LTS Period\n18    Hydrogen  v18.20.8 on 2025-03-27  2022-10-17 to 2025-04-30\n20    Iron      v20.19.1 on 2025-04-22  2023-10-16 to 2026-04-30\n22    Jod       v22.15.0 on 2025-04-22  2024-10-23 to 2027-04-30\n```\n\n## Reference\n\n- GitHub Actions: [New workflow features](https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/)\n- [Using tags for Release\n  management](https://docs.github.com/en/enterprise-cloud@latest/actions/creating-actions/about-custom-actions#using-release-management-for-actions)\n\n## Future\n\nGot ideas? Contributions are welcome. Submit a PR with tests and it will likely be accepted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsimerson%2Fnode-lts-versions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsimerson%2Fnode-lts-versions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsimerson%2Fnode-lts-versions/lists"}