Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

semver-sort

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semver-sort

Sort array of semver string even which is exist in a strings.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

semver-sort Build Status

Sort array of semver string even which is exist in a strings.

Install

$ npm install --save semver-sort

Usage

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().acs(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().acs(version);
//=> [ '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' ]

License

MIT © Jimmy Moon

Keywords

FAQs

Package last updated on 19 Sep 2015

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