Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

parse-node-version

gulpjs24.8mMIT2.0.0TypeScript support: definitely-typed

Turn node's process.version into something useful.

process.version, node version, version parse

readme

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

changelog

Changelog

2.0.0 (2021-11-22)

⚠ BREAKING CHANGES

  • Normalize repository, dropping node <10.13 support (#6)

Miscellaneous Chores

  • Normalize repository, dropping node <10.13 support (#6) (b4ea840)