sensordb2 e64a8defe5 3.17 | 1 year ago | |
---|---|---|
.. | ||
LICENSE | 1 year ago | |
README.md | 1 year ago | |
index.js | 1 year ago | |
package.json | 1 year ago |
Turn node's process.version into something useful.
var nodeVersion = require('parse-node-version')(process.version);
console.log(
nodeVersion.major,
nodeVersion.minor,
nodeVersion.patch,
nodeVersion.pre,
nodeVersion.build
);
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.
MIT