version string
OptionaloptionsOrLoose: boolean | Optionsan options object { loose } (where loose is the only available option) or a boolean indicating whether to enable loose mode. In loose mode, the parser is more forgiving with imperfectly formatted semver strings
OptionalthrowErrors: Twhether to throw an error if the version string is invalid or if there are other errors. Defaults to false
parsed version object, or null if the version string is invalid or if there are other errors (if throwErrors is truthy, an error will be thrown instead of returning null)
Return the parsed version of a semver string, if the semver string is not valid, it returns
nullor throws an error depending on the value ofthrowErrorsThrows
TypeError if the version string is invalid or if there are other errors (if
throwErrorsis falsy, it will returnnullinstead of throwing an error)Example
Remarks
build identifier (
[+BUILD]) is taken into account