New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

parse-semver

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-semver

Parse, normalize and validate given semver shorthand (e.g. gulp@v3.8.10) to object.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
263K
increased by5.3%
Maintainers
1
Weekly downloads
 
Created
Source

parse-semver npmjs.com The MIT License

Parse, normalize and validate given semver shorthand (e.g. gulp@v3.8.10) to object.

code climate standard code style travis build status coverage status dependency status

Install

npm i parse-semver --save
npm test

API

For more use-cases see the tests

parseSemver

It returns object with original version given, expanded semver range, and version which is valid semver version.

  • <shorthand> {String} the shorthand to parse, like docks@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@^2.2.2')
//=> {name: 'docks', original: '^2.2.2', range: '>=2.2.2 <3.0.0', version: '2.2.2'}

parseSemver('docks')
//=> {name: 'docks', original: '', range: '*', version: 'latest'}
  • benz: Compose your control flow with absolute elegance. Support async/await, callbacks, thunks, generators,… more
  • parse-git-log: Parse default git log style to array of objects from git repository… more
  • parse-github-url: Parse a github URL into an object.
  • parse-git-config: Parse .git/config into a JavaScript object. sync or async.
  • vez: Middleware composition at new level. Ultimate alternative to ware, plugins, koa-compose and… more

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

Keywords

FAQs

Package last updated on 23 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc