You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rdrew
573c318665
|
2 years ago | |
---|---|---|
.. | ||
LICENSE | 2 years ago | |
README.md | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago |
README.md
parse-node-version
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