New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

version_compare

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

version_compare

Compare version strings.

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

version_compare Build Status

===============

simple tool to compare version strings

####Install npm

npm install version_compare --save

bower

bower install version_compare --save

####Node

vc = require('./version_compare')
vc.matches('1.0', '1.1') ==> false
vc.matches('1.0', '1.0') ==> true
vc.compare('1.0', '1.1') ==> -1
vc.gt('1.0', '1.1') ==> false
vc.gte('1.0', '1.1') ==> false
vc.lt('1.0', '1.1') ==> true
vc.lte('1.0', '1.1') ==> true

####Browser

<script src="bower_components/version_compare/version_compare.js"></script>
<script>
VersionCompare.matches('1.0', '1.1') ==> false
VersionCompare.matches('1.0', '1.0') ==> true
VersionCompare.compare('1.0', '1.1') ==> -1
VersionCompare.gt('1.0', '1.1') ==> false
VersionCompare.gte('1.0', '1.1') ==> false
VersionCompare.lt('1.0', '1.1') ==> true
VersionCompare.lte('1.0', '1.1') ==> true
</script>

###Credit: This repo is based off of source found here: [http://stackoverflow.com/questions/6832596/how-to-compare-software-version-number-using-js-only-number].

Keywords

version

FAQs

Package last updated on 25 Aug 2015

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