Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@types/semver
Advanced tools
The @types/semver package provides TypeScript type definitions for the semver package, which is a utility for handling semantic versions. It allows developers to parse, compare, and manipulate semantic versions in TypeScript projects with type safety.
Parsing a version
This feature allows you to parse a semantic version string and access its components, such as the major, minor, and patch versions.
"import semver from 'semver';\nconst version = semver.parse('1.2.3');\nconsole.log(version.major); // 1"
Comparing versions
This feature enables you to compare two semantic version strings and determine their order.
"import semver from 'semver';\nconst result = semver.compare('1.2.3', '1.2.4');\nconsole.log(result); // -1"
Satisfying ranges
This functionality allows you to check if a semantic version satisfies a given version range.
"import semver from 'semver';\nconst satisfied = semver.satisfies('1.2.3', '^1.0.0');\nconsole.log(satisfied); // true"
This package provides functionality for comparing version numbers. While it offers similar version comparison capabilities, it lacks the broader feature set of semver, such as range checking and version parsing.
A simple package for comparing version strings. It is more lightweight than semver but does not support semantic versioning's pre-release and build metadata.
npm install --save @types/semver
This package contains type definitions for semver (https://github.com/npm/node-semver).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver/v6.
These definitions were written by Bart van der Schoor (https://github.com/Bartvds), BendingBender (https://github.com/BendingBender), Lucian Buzzo (https://github.com/LucianBuzzo), Klaus Meinhardt (https://github.com/ajafff), and ExE Boss (https://github.com/ExE-Boss).
FAQs
TypeScript definitions for semver
The npm package @types/semver receives a total of 19,501,761 weekly downloads. As such, @types/semver popularity was classified as popular.
We found that @types/semver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.