# test-version

> Test if a version matches the given versions

Latest version **1.0.3** (published 2015-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install test-version
pnpm add test-version
yarn add test-version
bun add test-version
```

## 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.0.3 |
| Published | 2015-12-02 |
| First published | 2015-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.11.9 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | sunhaohao |
| Maintainers | viringbells |
| Keywords | version |

## Links

- npm: https://www.npmjs.com/package/test-version
- Repository: https://github.com/viRingbells/test-version
- Issues: https://github.com/viRingbells/test-version/issues
- npm.io page: https://npm.io/package/test-version

## Dependencies (1)

- [debug](https://npm.io/package/debug.md) ^2.2.0

## Recent versions

- 1.0.3 (latest) — 2015-12-02
- 1.0.2 — 2015-12-01
- 1.0.1 — 2015-11-25
- 1.0.0 — 2015-11-25

## README

# test-version
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]

Test if a given version matches a version pattern

## Install

```
$ npm install test-version
```

## Usage

```
const test = require('test-version');

if (test('v1.0.0', '>=1.0.0')) {
    console.log('matched!');
}
else {
    console.log('not matched');
}
```

### Patterns

version can be like:

```
1.0.0 => 1.0.0
1-0-0 => 1.0.0
v1.0  => 1.0
```

version pattern can be like:

```
1.0.0
1.0.x
1.0.*
!1.0.0
~1.0.0
^1.0.0
>1.0.0
<1.0.0
1.0.0...1.9.9
1.0.0~1.9.9
```

[npm-image]: https://img.shields.io/npm/v/test-version.svg
[travis-image]: https://travis-ci.org/viRingbells/test-version.svg?branch=master
[npm-url]: https://www.npmjs.com/package/test-version
[travis-url]: https://travis-ci.org/viRingbells/test-version

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