Skip to content
Get Node current version
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
__tests__
.editorconfig
.eslintrc
.gitignore
.npmignore
.npmrc
.travis.yml
.yarnrc
LICENSE
Readme.md
azure-pipelines.yml
codecov.yml
index.js
package-lock.json
package.json
yarn.lock

Readme.md

NPM Version NPM Downloads Linux Build Windows Build Circle CI Build Codecov

Dependency Status devDependency Status

Node-version

A quick module that returns current node version parsed into parts.

Installation

yarn add node-version

Or

npm install node-version

Quick Start

var currentVersion = require('node-version');

/*
console.log(currentVersion);

{
    original: 'v0.4.10', // same as process.version
    short: '0.4',
    long: '0.4.10',
    major: '0',
    minor: '4',
    build: '10'
}
*/

Warning

Version 1.0.0 break 0.1.0 since its API changes.

Change

var currentVersion = new (require('node-version')).version();

To

var currentVersion = require('node-version');
You can’t perform that action at this time.