Kevin 29b9a0c50c clean && clean html base | 4 years ago | |
---|---|---|
.. | ||
index.js | 4 years ago | |
license | 4 years ago | |
package.json | 4 years ago | |
readme.md | 4 years ago |
Truncate a semver version:
1.2.3
→1.2.0
$ npm install --save semver-truncate
const semverTruncate = require('semver-truncate');
semverTruncate('1.2.3-foo', 'patch');
//=> '1.2.3'
semverTruncate('1.2.3', 'minor');
//=> '1.2.0'
semverTruncate('1.2.3', 'major');
//=> '1.0.0'
Type: string
Semver version.
Type: string
Values: patch
minor
major
Version type to truncate to.
MIT © Sindre Sorhus