
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
semver-sort
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Sort array of semver string even which is exist in a strings.
$ npm install --save semver-sort
var version = [
'v0.0.2',
'v0.1.1',
'2.0.1',
'1.2.2',
'1.1.1',
'v0.0.9'
];
var semverSort = require('semver-sort');
semverSort.asc(version);
//=> [ 'v0.0.2', 'v0.0.9', 'v0.1.1', '1.1.1', '1.2.2', '2.0.1' ]
semverSort.desc(version);
//=> [ '2.0.1', '1.2.2', '1.1.1', 'v0.1.1', 'v0.0.9', 'v0.0.2' ]
var tags = [
{ref: 'refs/tags/v1.0.2'},
{ref: 'refs/tags/v0.1.1'},
{ref: 'refs/tags/v0.1.0'},
{ref: 'refs/tags/v1.1.0'},
{ref: 'refs/tags/v1.0.3'},
{ref: 'refs/tags/v1.0.1'},
{ref: 'refs/tags/v1.0.0'}
];
semverSort.asc(tags.map(function (tag) {
return tag.ref;
}));
//=> [ 'refs/tags/v0.1.0', 'refs/tags/v0.1.1', 'refs/tags/v1.0.0', 'refs/tags/v1.0.1', 'refs/tags/v1.0.2', 'refs/tags/v1.0.3', 'refs/tags/v1.1.0' ]
MIT © Jimmy Moon
FAQs
Sort array of semver string even which is exist in a strings.
The npm package semver-sort receives a total of 17,021 weekly downloads. As such, semver-sort popularity was classified as popular.
We found that semver-sort demonstrated a not healthy version release cadence and project activity because the last version was released 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
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.