open-index/open-npm huggingface dataset:
npm package: @grinstead/cddl
Description: Validate and parse Concise Data Definition Language (CDDL) files
Latest version: 1.0.0

# `@grinstead/cddl`

Validate CDDL files from the command line and in Node.js.

The parser is based on the RFC 8610 Appendix B grammar.
Source-of-truth is ABNF in `src/grammar/cddl.abnf`, which is converted
to Peggy in build steps.

## CLI

```bash
npx @grinstead/cddl validate schema.cddl
```

On success:

```text
valid CDDL: schema.cddl
```

On failure, output includes line and column when available.

You can validate multiple files in one call:

```bash
npx @grinstead/cddl validate a.cddl b.cddl
```

You can also validate from standard input:

```bash
cat schema.cddl | npx @grinstead/cddl validate -
```

## Library

```ts
import { parseCddl } from "@grinstead/cddl";

parseCddl("person = { age: int }");
```

## Development

```bash
npm install
npm test
```

Parser generation:

```bash
npm run generate:peggy
npm run generate:parser
```