Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gulpjs/parse-node-version
Turn node's process.version into something useful.
https://github.com/gulpjs/parse-node-version
gulp nodejs parser version
Last synced: 7 days ago
JSON representation
Turn node's process.version into something useful.
- Host: GitHub
- URL: https://github.com/gulpjs/parse-node-version
- Owner: gulpjs
- License: mit
- Created: 2018-11-29T21:20:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-22T23:21:43.000Z (about 3 years ago)
- Last Synced: 2024-10-29T12:58:58.769Z (3 months ago)
- Topics: gulp, nodejs, parser, version
- Language: JavaScript
- Size: 11.7 KB
- Stars: 2
- Watchers: 7
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# parse-node-version
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]
Turn node's process.version into something useful.
## Usage
```js
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
[downloads-image]: http://img.shields.io/npm/dm/parse-node-version.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/parse-node-version
[npm-image]: http://img.shields.io/npm/v/parse-node-version.svg?style=flat-square[ci-url]: https://github.com/gulpjs/parse-node-version/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/parse-node-version/dev?style=flat-square[coveralls-url]: https://coveralls.io/r/gulpjs/parse-node-version
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/parse-node-version/master.svg?style=flat-square