Validate semver version strings strictly. Will not accept wildcards and version ranges.
validate('1.0.0-rc.1'); // return truevalidate('1.0-rc.1'); // return falsevalidate('foo'); // return false Copy
validate('1.0.0-rc.1'); // return truevalidate('1.0-rc.1'); // return falsevalidate('foo'); // return false
Version number to validate
true if the version number is a valid semver version number false otherwise
true
false
Validate semver version strings strictly. Will not accept wildcards and version ranges.
Example