Socket
Socket
Sign inDemoInstall

@types/semver

Package Overview
Dependencies
0
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/semver

TypeScript definitions for semver


Version published
Weekly downloads
25M
decreased by-0.7%
Maintainers
1
Install size
23.0 kB
Created
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: Wed, 26 Oct 2022 20:03:05 GMT
  • Dependencies: none
  • Global values: 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 26 Oct 2022

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.

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