Socket
Socket
Sign inDemoInstall

@types/semver

Package Overview
Dependencies
0
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Protect your apps from supply chain attacks

Install

@types/semver

TypeScript definitions for semver

    7.5.8ts4.6ts4.7ts4.8ts4.9ts5.0ts5.1ts5.2ts5.3ts5.4latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
25,613,918
increased by3.22%

Weekly downloads

Package description

What is @types/semver?

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.

What are @types/semver's main functionalities?

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"

Other packages similar to @types/semver

Readme

Source

Installation

npm install --save @types/semver

Summary

This package contains type definitions for semver (https://github.com/npm/node-semver).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/semver.

Additional Details

  • Last updated: Sat, 24 Feb 2024 16:35:28 GMT
  • Dependencies: none

Credits

These definitions were written by Bart van der Schoor, BendingBender, Lucian Buzzo, Klaus Meinhardt, ExE Boss, and Piotr Błażejewicz.

FAQs

Last updated on 24 Feb 2024

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc