node-lifecycle
v1.0.4
Published
CLI tool to check Node.js version lifecycle and EOL status
Maintainers
Readme
node-lifecycle
Check the lifecycle status (Current, Active LTS, Maintenance, or EOL) of any Node.js version — right from your terminal.
📦 Installation
Option 1: Global install (CLI available anywhere)
npm install -g node-lifecycleAfter this, you can run the CLI directly:
node-lifecycleOption 2: Local install (in your project)
npm install --save-dev node-lifecycleWith a local install, binaries live in node_modules/.bin.
You can run it in one of two ways:
Use npx (simple):
npx node-lifecycleOR:
Add an npm script:
"scripts": {
"check-node": "node-lifecycle"
}Then run:
npm run check-nodeOption 3: Run without installing at all
npx node-lifecycleThis will fetch the latest version from npm on demand.
Option 4: CircleCi Only - See CI Config Below
🚀 Usage
Check the status of your current Node.js version:
node-lifecycleCheck the status of a specific version:
node-lifecycle --version=18.20.4⚙️ Options
| Flag | Description |
| ------------------ | --------------------------------------------------------------------------------- |
| --version=VER | Check this specific Node.js version instead of your current runtime. |
| --warn-days=N | Warn if EOL is within N days (default: 180). |
| --cache-ttl=SECS | Cache the Node.js release schedule for N seconds (default: 86400 / 24 hours). |
| --no-fail | Do not exit with code 2 on EOL (still prints ❌). |
| --help | Show help message. |
📋 Examples
Check a Node version close to EOL:
node-lifecycle --version=20.5.0Use a shorter warning window:
node-lifecycle --warn-days=30Check with no failure on EOL (useful for CI logs):
node-lifecycle --version=18.20.4 --no-failExit Codes
| Code | Meaning |
| ---- | ------------------------------------------ |
| 0 | OK (supported) |
| 1 | Warning (within warn-days of EOL) |
| 2 | EOL (unless --no-fail is used, then 0) |
🧪 CI Integration and GitHub Actions
CircleCI
There are two ways to use node-lifecycle in CircleCI:
Without installing in your repo (uses npx)
This always fetches the latest published version from npm:
jobs:
verify:
docker:
- image: cimg/node:20.12
steps:
- checkout
- run:
name: Node lifecycle check
command: npx node-lifecycle --warn-days=180With devDependencies (preferred if already in your repo)
If you already have node-lifecycle in devDependencies, npm ci will install it and you can run it directly:
jobs:
verify:
docker:
- image: cimg/node:20.12
steps:
- checkout
- run: npm ci
- run:
name: Node lifecycle check
command: node-lifecycle --warn-days=180GitHub Actions
Example GitHub Actions job to fail if Node.js is near or past EOL:
jobs:
check-node-lifecycle:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install -g node-lifecycle
- run: node-lifecycle📄 License
MIT © 2025 Kelsey Salguera
Note: This tool fetches Node.js release schedules from official sources (nodejs/Release and endoflife.date) and caches them locally for faster performance.
