1.0.0 • Published 6 years ago

build-version-compare v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

build-version-compare

npm license

A Node package to compare two version strings of the format major.minor.patch.buildnumber.

Installation

$ yarn add build-version-compare
$  npm install --save build-version-compare

Usage

import {comparator} from 'build-version-compare';

const artifactVersions = [ 
  '3.20.0.10',
  '3.20.0.11',
  '3.20.0.12',
  '3.20.0.13',
  '3.20.0.14',
  '3.20.0.15',
  '3.20.0.16',
  '3.20.0.17',
  '3.20.0.18',
  '3.20.0.19',
  '3.20.0.2',
  '3.20.0.20',
  '3.20.0.21',
  '3.20.0.3',
  '3.20.0.4',
  '3.20.0.5',
  '3.20.0.6',
  '3.20.0.7',
  '3.20.0.8',
  '3.20.0.9' 
];
console.log(artifactVersions.sort(comparator));