# spdx-satisfies

> test whether SPDX expressions satisfy licensing criteria

Latest version **6.0.0** (published 2025-01-07) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 33/100 (F)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

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

## Links

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

## Dependencies (3)

- [spdx-ranges](https://npm.io/package/spdx-ranges.md) ^2.0.0
- [spdx-compare](https://npm.io/package/spdx-compare.md) ^1.0.0
- [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

- 6.0.0 (latest) — 2025-01-07
- 5.0.1 — 2021-05-09
- 5.0.0 — 2019-03-02
- 4.0.1 — 2018-12-14
- 4.0.0 — 2018-03-07
- 0.1.3 — 2015-08-02
- 0.1.2 — 2015-07-19
- 0.1.1 — 2015-07-18
- 0.1.0 — 2015-07-18

## README

`satisfies(SPDX license expression, array of approved licenses)`

Approved licenses may be simple license identifiers like `MIT`, plus-ranges like `EPL-2.0+`, or licenses with exceptions like `Apache-2.0 WITH LLVM`.  They may _not_ be compound expressions using `AND` or `OR`.

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

assert(satisfies('MIT', ['MIT', 'ISC', 'BSD-2-Clause', 'Apache-2.0']))
assert(satisfies('GPL-2.0 OR MIT', ['MIT']))
assert(!satisfies('GPL-2.0 AND MIT', ['MIT']))
assert(satisfies('GPL-3.0', ['GPL-2.0+']))
assert(!satisfies('GPL-1.0', ['GPL-2.0+']))
```

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