Socket
Socket
Sign inDemoInstall

@storybook/semver

Package Overview
Dependencies
Maintainers
16
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/semver

The semantic version parser used by npm for browser.


Version published
Maintainers
16
Created

What is @storybook/semver?

The @storybook/semver package is a utility for handling semantic versioning (semver) in a way that's tailored for Storybook's needs. It provides functions to compare, increment, and analyze version strings according to the semantic versioning specification. This package is particularly useful for developers working with Storybook to manage versioning of their components and stories in a consistent manner.

What are @storybook/semver's main functionalities?

Comparing versions

This feature allows you to compare two version strings to determine if one is greater than the other according to semver rules. It's useful for determining if a version upgrade is needed.

"const { gt } = require('@storybook/semver');\nconsole.log(gt('2.1.0', '2.0.0')); // true"

Incrementing versions

This feature enables you to increment a version string by a major, minor, or patch level. It's useful for automating version updates in a semver-compliant way.

"const { inc } = require('@storybook/semver');\nconsole.log(inc('1.0.0', 'major')); // '2.0.0'\nconsole.log(inc('2.1.3', 'patch')); // '2.1.4'"

Analyzing versions

This feature provides a way to parse a version string into its constituent parts (major, minor, patch). It's useful for when you need to inspect or manipulate individual parts of a version string.

"const { parse } = require('@storybook/semver');\nconst versionInfo = parse('1.5.9');\nconsole.log(versionInfo); // { major: 1, minor: 5, patch: 9, version: '1.5.9' }"

Other packages similar to @storybook/semver

FAQs

Package last updated on 26 May 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc