# compare-semver

> Compare semver versions to many other semver versions

Latest version **1.1.0** (published 2015-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install compare-semver
pnpm add compare-semver
yarn add compare-semver
bun add compare-semver
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-09-01 |
| First published | 2014-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Scott Corgan |
| Maintainers | scottcorgan |

## Links

- npm: https://www.npmjs.com/package/compare-semver
- Repository: https://github.com/scottcorgan/compare-semver
- Issues: https://github.com/scottcorgan/compare-semver/issues
- npm.io page: https://npm.io/package/compare-semver

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ^5.0.1

## Recent versions

- 1.1.0 (latest) — 2015-09-01
- 1.0.0 — 2015-01-06
- 0.3.3 — 2014-07-09
- 0.3.2 — 2014-07-01
- 0.3.1 — 2014-06-30
- 0.3.0 — 2014-06-30
- 0.2.0 — 2014-06-30
- 0.1.1 — 2014-06-30
- 0.1.0 — 2014-06-30

## README

# compare-semver

Compare semver versions to many other semver versions.

## Install

```
npm install compare-semver --save
```

### Usage

```js
var compare = require('compare-semver');
var versions = [
  '0.0.11',
  '0.1.0',
  '0.2.0',
  '0.1.11'
];

var maxSemver = compare.max(versions);
```

## Methods

### max(versions)

Returns the greatest version from the list of versions

* `versions` - an array of semantic versions

### min(versions)

Returns the smallest version from the list of versions

* `versions` - an array of semantic versions

### gt(version, versions)

Compare that  single version is greater than all versions in the list

* `version` - the version to compare
* `versions` - an array of semantic versions

### lt(version, versions)

Compare that  single version is less than all versions in the list

* `version` - the version to compare
* `versions` - an array of semantic versions

### unique(version, versions)

Is the given version unique compared to the list of versions

* `version` - the version to compare
* `versions` - an array of semantic versions

## Run Tests

```
npm install
npm test
```

---
_Source: https://npm.io/package/compare-semver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
