prc b6c02717e6 Upload complete no-internet building environment. 1 год назад
..
LICENSE b6c02717e6 Upload complete no-internet building environment. 1 год назад
README.md b6c02717e6 Upload complete no-internet building environment. 1 год назад
index.js b6c02717e6 Upload complete no-internet building environment. 1 год назад
package.json b6c02717e6 Upload complete no-internet building environment. 1 год назад

README.md

parse-node-version

NPM version Downloads Travis Build Status AppVeyor Build Status Coveralls Status Gitter chat

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