
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
joi-extension-semver
Advanced tools
Semver extension for the Joi validation library
const { semver, semverRange } = require('joi-extension-semver')
const Joi = require('joi')
.extend(semver)
.extend(semverRange)
Joi.attempt('1.2.3', Joi.semver().valid()) // '1.2.3'
Joi.attempt('>=1.2.3', Joi.semverRange().valid()) // '>=1.2.3'
Joi.attempt('1.2.3', Joi.semver().gte('1.2.3')) // '1.2.3'
Joi.attempt('1.2.3', Joi.semver().lt('1.2.3')) // throws ValidationError
Joi.attempt('1.2.3', Joi.semver().satisfies('^1.0.0')) // '1.2.3'
See semver documentation. All boolean
returning comparisons are supported.
semver
Starts the chain.
semver.valid()
Asserts valid(value)
.
semver.gt(exp)
Asserts gt(value, exp)
.
semver.gte(exp)
Asserts gte(value, exp)
.
semver.lt(exp)
Asserts lt(value, exp)
.
semver.lte(exp)
Asserts lte(value, exp)
.
semver.eq(exp)
Asserts eq(value, exp)
.
semver.neq(exp)
Asserts neq(value, exp)
.
semver.cmp(comp, exp)
Asserts cmp(value, comp, exp)
.
semver.satisfies(rng)
Asserts satisfies(value, rng)
.
semver.gtr(rng)
Asserts gtr(value, rng)
.
semver.ltr(rng)
Asserts ltr(value, rng)
.
semver.outside(hilo, rng)
Asserts outside(value, hilo, rng)
.
semverRange
Starts the chain.
semverRange.valid()
Asserts validRange(value)
.
5.0.0
FAQs
Semver extension for the Joi validation library
The npm package joi-extension-semver receives a total of 4,742 weekly downloads. As such, joi-extension-semver popularity was classified as popular.
We found that joi-extension-semver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.