npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-version

v4.3.0

Published

Get Node current version

Readme

NPM Version NPM Downloads GitHub Actions Codecov

node-version

A lightweight utility to get the current Node.js version parsed into a structured object.

Features

  • 🚀 Fast and Lightweight: Barely any overhead.
  • 📦 ESM Only: Built for modern environments.
  • 🛠️ TypeScript Ready: Full type definitions included.
  • 📅 LTS & EOL Checks: Identify LTS releases and End-of-Life versions.
  • 🚦 Comparison Helpers: is(), isAtLeast(), isAbove(), isBelow(), isAtMost() checks.

Installation

# Using npm
npm install node-version

# Using Yarn
yarn add node-version

# Using pnpm
pnpm add node-version

# Using Bun
bun add node-version

Quick Start

import { version } from 'node-version';

console.log(version);
/*
{
    original: 'v20.10.0', // same as process.version
    short: '20.10',
    long: '20.10.0',
    major: '20',
    minor: '10',
    build: '0',

    isAtLeast: [Function],
    isAbove: [Function],
    isBelow: [Function],
    isAtMost: [Function],
    is: [Function],
    isLTS: true, // or false
    ltsName: 'Iron', // or undefined
    isEOL: false // or true
}
*/

API Reference

version

The pre-instantiated version object for the current process.

getVersion()

Returns a new NodeVersion object representing the current process version.

import { getVersion } from 'node-version';
const v = getVersion();

NodeVersion Object

| Property | Type | Description | | :--- | :--- | :--- | | original | string | The version string prefixed with 'v' (e.g., 'v20.10.0'). | | short | string | The major and minor version (e.g., '20.10'). | | long | string | The full version string (e.g., '20.10.0'). | | major | string | The major version number. | | minor | string | The minor version number. | | build | string | The build/patch version number. | | isAtLeast(version) | (v: string) => boolean | Checks if the current version is ≥ the specified version. | | isAbove(version) | (v: string) => boolean | Checks if the current version is > the specified version. | | isBelow(version) | (v: string) => boolean | Checks if the current version is < the specified version. | | isAtMost(version) | (v: string) => boolean | Checks if the current version is ≤ the specified version. | | is(version) | (v: string) => boolean | Checks if the current version is exactly the specified version. | | isLTS | boolean | true if the current version is an LTS release. | | ltsName | string | The LTS codename (e.g., 'Iron') or undefined. | | isEOL | boolean | true if the current version is past its End-of-Life date. |

Compare Versions

import { version } from 'node-version';

if (version.isAtLeast('20.0.0')) {
  console.log('Running on Node.js 20 or newer');
}

if (version.is('22.0.0')) {
  console.log('Running on exactly Node.js 22.0.0');
}

if (version.isAbove('20.0.0')) {
  console.log('Running on Node.js strictly above 20.0.0');
}

if (version.isBelow('22.0.0')) {
  console.log('Running on Node.js strictly below 22.0.0');
}

ESM Requirements

This package is ESM-only and requires Node.js 20+.

If you need CommonJS support, use node-version@3:

npm install node-version@3

Development

Scripts

  • bun run build: Build the project using tsdown.
  • bun run test: Run tests using vitest.
  • bun run lint: Run linting checks using biome.
  • bun run format: Format the code using biome.
  • bun run check-exports: Verify package exports are correct.

Publishing

This project uses Changesets for versioning and publishing.

# Prepare a new version (updates changelog and package.json)
bun run changeset:version

# Publish to NPM
bun run changeset:release

License

MIT