valibot-schema-spdx
Version:
Valibot schema for SPDX identifiers
37 lines (25 loc) • 1.31 kB
Markdown
# valibot-schema-spdx
> Valibot schema for [SPDX identifiers](https://spdx.github.io/).
[](https://github.com/idleberg/valibot-schemas/blob/main/LICENSE)
[](https://www.npmjs.org/package/valibot-schema-spdx)
[](https://jsr.io/@idleberg/valibot-schema-spdx)
[](https://github.com/idleberg/valibot-schemas/actions/workflows/node.yml)
> [!NOTE]
> This libray isn't as lightweight as most built-in Valibot schemas, so it might not be suitable for some use-cases.
## Installation
```shell
# NodeJS
npm install valibot-schema-spdx
# Deno
deno add jsr:@idleberg/valibot-schema-spdx
```
## Usage
```javascript
import { parse } from "valibot";
import { spdx, osi } from "valibot-schema-spdx";
parse(spdx(), "MIT"); // true
parse(osi(), "GPL-3.0-or-later"); // true
parse(osi(), "CC0-1.0"); // false
```
## License
This work is licensed under [The MIT License](LICENSE).