{"library":"node-version","title":"Node.js Version Utility","description":"node-version is a lightweight JavaScript utility designed to parse the current Node.js runtime version (from `process.version`) into a structured object. It provides granular access to major, minor, and patch segments, alongside powerful helper methods for semantic version comparison, such as `isAtLeast`, `isAbove`, `isBelow`, and `isAtMost`. The package, currently at stable version 4.3.0, maintains an active release cadence with minor and patch updates introducing features like `eolDate` and `daysUntilEOL`. Key differentiators include its pure ESM architecture (since v4), full TypeScript support, and built-in checks for Node.js Long Term Support (LTS) status and End-of-Life (EOL) dates, making it an ideal choice for modern Node.js applications that require robust version management and awareness.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-version"],"cli":null},"imports":["import { version } from 'node-version';","import { getVersion } from 'node-version';","import type { NodeVersion } from 'node-version';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { version, getVersion } from 'node-version';\n\n// Access the pre-instantiated version object\nconsole.log('Current Node.js version:', version.long);\nconsole.log('Is LTS?', version.isLTS);\nif (version.isLTS) {\n  console.log('LTS Name:', version.ltsName);\n}\nconsole.log('Is EOL?', version.isEOL);\nif (version.isEOL) {\n    console.log('End-of-Life Date:', version.eolDate);\n    console.log('Days until EOL:', version.daysUntilEOL);\n}\n\n// Perform version comparisons\nif (version.isAtLeast('20.0.0')) {\n  console.log('Running on Node.js 20 or newer.');\n} else {\n  console.log('Running on an older Node.js version.');\n}\n\nif (version.isAbove('22.0.0')) {\n  console.log('Running on Node.js strictly above 22.0.0.');\n}\n\n// Get a new NodeVersion instance\nconst specificVersion = getVersion();\nconsole.log('Another instance (same info):', specificVersion.original);","lang":"typescript","description":"Demonstrates importing the `version` object and accessing its parsed properties and helper methods, including LTS/EOL checks. Also shows `getVersion()`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}