Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.95 KB

README.md

File metadata and controls

57 lines (38 loc) · 1.95 KB

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.

Strict No LLM / No AI Policy

No LLMs for issues.

No LLMs for patches / pull requests.

No LLMs for comments on the bug tracker, including translation.

English is encouraged, but not required. You are welcome to post in your native language and rely on others to have their own translation tools of choice to interpret your words.

License

MIT