Package Exports
- parse-semver
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-semver) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Parse, normalize and validate given semver shorthand (e.g. gulp@v3.8.10) to object.
Install
npm i --save parse-semver
npm test
API
For more use-cases see the tests
parseSemver
It returns object with
original
version given, expanded semverrange
, andversion
which is valid semver version.
<shorthand>
{String} the shorthand to parse, likemocha@v2.2.0
return
{Object} object with few properties
Example
var parseSemver = require('parse-semver');
parseSemver('docks@~3.4.5');
//=> {name: 'docks', original: '~3.4.5', range: '>=3.4.5 <3.5.0', version: '3.4.5'}
parseSemver('docks@v1.2.3');
//=> {name: 'docks', original: 'v1.2.3', range: '1.2.3', version: '1.2.3'}
parseSemver('docks');
//=> {name: 'docks', original: '', range: '*', version: ''}
Author
Charlike Mike Reagent
License 
Copyright (c) 2015 Charlike Mike Reagent, contributors.
Released under the MIT
license.
Powered and automated by kdf, March 26, 2015