parse-node-version
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/parse-node-version package

2.0.0 • Public • Published

parse-node-version

NPM version Downloads Build Status Coveralls Status

Turn node's process.version into something useful.

Usage

var nodeVersion = require('parse-node-version')(process.version);

console.log(
  nodeVersion.major,
  nodeVersion.minor,
  nodeVersion.patch,
  nodeVersion.pre,
  nodeVersion.build
);

API

parseVersion(nodeVersionString)

Takes a node version string (usually process.version) and returns an object with the major/minor/patch (which will all be numbers) and pre/build keys (which will always be a string). If the version doesn't contain any pre-release or build information, the properties will be returned as empty string.

License

MIT

Package Sidebar

Install

npm i parse-node-version

Weekly Downloads

5,337,876

Version

2.0.0

License

MIT

Unpacked Size

4.26 kB

Total Files

4

Last publish

Collaborators

  • phated