|
|
5 years ago | |
|---|---|---|
| .. | ||
| index.js | 5 years ago | |
| license | 5 years ago | |
| package.json | 5 years ago | |
| readme.md | 5 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