is-stable-version

Utility function to see if a SemVer version isn't a prerelease.

Usage no npm install needed!

<script type="module">
  import isStableVersion from 'https://cdn.skypack.dev/is-stable-version';
</script>

README

is-stable-version

CI Badge NPM Badge

Utility function to see if a SemVer version isn't a prerelease.

Installation

Install is-stable-version through npm:

$ npm install is-stable-version

Usage

import isStableVersion from "is-stable-version";

isStableVersion("1.0.0"); //=> true
isStableVersion("1.0.0-alpha"); //=> false

isStableVersion("=v1.0.0"); //=> true
isStableVersion("=v1.0.0-alpha"); //=> false

isStableVersion(" = v 1.0.0"); //=> throws RangeError
isStableVersion(" = v 1.0.0", { loose: true }); //=> true

isStableVersion("1.0.0alpha"); //=> throws RangeError
isStableVersion("1.0.0alpha", { loose: true }); //=> false

License

This package is available as open source under the terms of the MIT License.