# spdx-compare

> compare SPDX license expressions

Latest version **1.0.0** (published 2018-03-07) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-03-07 |
| First published | 2015-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/spdx-compare) |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Kyle E. Mitchell |
| Maintainers | kemitchell |
| Keywords | SPDX, law, legal, license, metadata, package, package.json, standards |

## Links

- npm: https://www.npmjs.com/package/spdx-compare
- Repository: https://github.com/kemitchell/spdx-compare.js
- Homepage: https://github.com/kemitchell/spdx-compare.js#readme
- Issues: https://github.com/kemitchell/spdx-compare.js/issues
- npm.io page: https://npm.io/package/spdx-compare

## Dependencies (3)

- [spdx-ranges](https://npm.io/package/spdx-ranges.md) ^2.0.0
- [array-find-index](https://npm.io/package/array-find-index.md) ^1.0.2
- [spdx-expression-parse](https://npm.io/package/spdx-expression-parse.md) ^3.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-03-07
- 0.1.2 — 2015-08-02
- 0.1.0 — 2015-07-18

## README

```javascript
var assert = require('assert')
var compare = require('spdx-compare')

assert(compare.gt('GPL-3.0', 'GPL-2.0'))
assert(compare.gt('GPL-3.0-only', 'GPL-2.0-only'))
assert(compare.gt('GPL-2.0-or-later', 'GPL-2.0-only'))
assert(compare.eq('GPL-3.0-or-later', 'GPL-3.0-only'))
assert(compare.lt('MPL-1.0', 'MPL-2.0'))

assert(compare.gt('LPPL-1.3a', 'LPPL-1.0'))
assert(compare.gt('LPPL-1.3c', 'LPPL-1.3a'))
assert(!compare.gt('MIT', 'ISC'))
assert(!compare.gt('OSL-1.0', 'OPL-1.0'))
assert(compare.gt('AGPL-3.0', 'AGPL-1.0'))

assert.throws(function () {
  compare.gt('(MIT OR ISC)', 'GPL-3.0')
}, '"(MIT OR ISC)" is not a simple license identifier')
```

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