Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vilicvane/semver-match
A simple function that conforms npm package version matching behavior.
https://github.com/vilicvane/semver-match
Last synced: 20 days ago
JSON representation
A simple function that conforms npm package version matching behavior.
- Host: GitHub
- URL: https://github.com/vilicvane/semver-match
- Owner: vilicvane
- Created: 2016-05-27T03:54:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-05-27T04:13:12.000Z (over 8 years ago)
- Last Synced: 2024-11-30T15:42:01.470Z (23 days ago)
- Language: TypeScript
- Size: 27.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![NPM Package](https://badge.fury.io/js/semver-match.svg)](https://www.npmjs.com/package/semver-match)
[![Build Status](https://travis-ci.org/vilic/semver-match.svg)](https://travis-ci.org/vilic/semver-match)# Semver Match
A simple function that conforms npm package version matching behavior.
## Install
```sh
npm install semver-match --save
```## Usage
```ts
import match from 'semver-match';match('^0.1.0', ['0.1.0', '0.1.1', '0.2.0']); // "0.1.1"
match('*', ['0.1.0', '0.2.0'], { latest: '0.1.0' }); // "0.1.0"
match('next', ['0.1.0', '0.2.0'], { latest: '0.1.0', next: '0.2.0' }); // "0.2.0"
```## License
MIT License.