Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

simple-semver

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-semver

simple-semver

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
108
increased by83.05%
Maintainers
2
Weekly downloads
 
Created
Source

Build Status

simple-semver

Install

$ npm install simple-semver --save

Usage

const simpleSemver = require('simple-semver')

simpleSemver.validate('1.3.0') // true
simpleSemver.validate('a.b.0') // false
simpleSemver.validate('1.0')   // false
// simple-semver only support xx.xx.xx(only contain Number and dot(.)) temporarily

simpleSemver.gt('1.3.0', '1.1.0') // true (gt means greater than)
simpleSemver.lt('1.1.0', '1.5.0') // true (lt means less than)

simpleSemver.gte('1.3.0', '1.1.0') // true (gte means greater than or equal)
simpleSemver.gte('1.3.0', '1.3.0') // true 
simpleSemver.gte('1.1.0', '1.3.0') // false

simpleSemver.lte('1.1.0', '1.3.0') // true (lte means less than or equal)
simpleSemver.lte('1.3.0', '1.3.0') // true 
simpleSemver.lte('1.3.0', '1.1.0') // false

simpleSemver.lt('1.1.0-alpha', '1.5.0') // true ('-alpha' will be ignore)

License

MIT

Keywords

FAQs

Package last updated on 09 Aug 2017

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