Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@lerna/prerelease-id-from-version
Advanced tools
@lerna/prerelease-id-from-version is a utility package that helps in extracting the prerelease identifier from a given version string. This can be particularly useful in managing and automating versioning in monorepos or multi-package repositories.
Extract Prerelease Identifier
This feature allows you to extract the prerelease identifier (e.g., 'alpha', 'beta') from a given version string. This can be useful for conditional logic based on the type of prerelease.
const prereleaseIdFromVersion = require('@lerna/prerelease-id-from-version');
const version = '1.0.0-alpha.1';
const prereleaseId = prereleaseIdFromVersion(version);
console.log(prereleaseId); // Output: 'alpha'
The 'semver' package is a comprehensive library for parsing, validating, and comparing semantic versioning strings. It also includes functionality to extract prerelease identifiers, among many other features. Compared to @lerna/prerelease-id-from-version, 'semver' offers a broader range of versioning utilities.
Similar to 'semver', 'node-semver' is another package that provides extensive tools for working with semantic versioning. It includes methods for parsing versions, comparing them, and extracting prerelease identifiers. It is more feature-rich compared to @lerna/prerelease-id-from-version, which focuses solely on extracting prerelease identifiers.
@lerna/prerelease-id-from-version
Get the prerelease ID from a version string
const { prereleaseIdFromVersion } = require("@lerna/prerelease-id-from-version");
prereleaseIdFromVersion(1.0.0-alpha.0); // => "alpha"
prereleaseIdFromVersion(1.0.0); // => undefined
prereleaseIdFromVersion(); // => undefined
Install lerna for access to the lerna
CLI.
FAQs
Get the prerelease ID from a version string
The npm package @lerna/prerelease-id-from-version receives a total of 347,496 weekly downloads. As such, @lerna/prerelease-id-from-version popularity was classified as popular.
We found that @lerna/prerelease-id-from-version 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.