Comparator to determine if a version is less than, equivalent to, or greater than another version
import versionCompare from 'egg-version-compare'
console.log(['1.1', '2', '1.0'].sort(versionCompare))
// 1.0, 1.1, 2
- Install:
npm install --save egg-version-compare
- Import:
import pkg from ('egg-version-compare')
- Require:
const pkg = require('egg-version-compare').default