# @shexjs/eval-validator-api

> Shape Expressions triple expression evaluator api - defines how @shexjs/validator invokes regex evaluators.

Latest version **1.0.0-alpha.33** (published 2026-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @shexjs/eval-validator-api
pnpm add @shexjs/eval-validator-api
yarn add @shexjs/eval-validator-api
bun add @shexjs/eval-validator-api
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.33 |
| Published | 2026-09-14 |
| First published | 2022-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 2 |
| Unpacked size | 46.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 62 |
| Author | Eric Prud'hommeaux |
| Maintainers | ericprud, justinwb |
| Keywords | shex, shape expressions, rdf, query, parser |

## Links

- npm: https://www.npmjs.com/package/@shexjs/eval-validator-api
- Repository: https://github.com/shexjs/shex.js
- Homepage: https://github.com/shexjs/shex.js#readme
- Issues: https://github.com/shexSpec/grammar/issues
- npm.io page: https://npm.io/package/@shexjs/eval-validator-api

## Dependencies (2)

- [@shexjs/term](https://npm.io/package/@shexjs/term.md) ^1.0.0-alpha.28
- [@types/shexj](https://npm.io/package/@types/shexj.md) ^2.1.7

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.0-alpha.33 (latest) — 2026-09-14
- 1.0.0-alpha.31 — 2026-09-06
- 1.0.0-alpha.30 — 2026-08-31
- 1.0.0-alpha.29 — 2023-11-11
- 1.0.0-alpha.28 — 2023-11-05
- 1.0.0-alpha.27 — 2023-10-23
- 1.0.0-alpha.25 — 2023-03-21
- 1.0.0-alpha.24 — 2022-09-16
- 1.0.0-alpha.23 — 2022-08-23
- 1.0.0-alpha.22 — 2022-08-18

## README

# @shexjs/eval-validator-api

[![npm version](https://img.shields.io/npm/v/@shexjs/eval-validator-api)](https://www.npmjs.com/package/@shexjs/eval-validator-api)
[![CI](https://github.com/shexjs/shex.js/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/shexjs/shex.js/actions/workflows/ci.yml)

The interface between [`@shexjs/validator`](../shex-validator#readme) and its pluggable matching engines: types for compiling a shape's triple expression and matching a node's triples against it, plus what the engine hands back (solutions, errors) and the hooks it calls along the way (semantic-action dispatch, EXTENDS/RESTRICTS handling, no-triple-constraint checks).

The validator walks shape *expressions* (AND/OR/NOT, node constraints, references); when it reaches a `Shape`, it asks an engine implementing this API to match the triple expression inside. Two implementations ship with the suite:

* [`@shexjs/eval-threaded-nerr`](../eval-threaded-nerr#readme) (default) — enumerates every way the data fails to match;
* [`@shexjs/eval-simple-1err`](../eval-simple-1err#readme) — stops at the first error.

An engine exports a `RegexpModule` (a `ValidatorRegexModule`): `compile(schema, shape, index)` returns the `ValidatorRegexEngine` that matches one shape's expression. Select an engine with the validator's `regexModule` option:

``` js
new ShExValidator(schema, db, {
  regexModule: require("@shexjs/eval-simple-1err").RegexpModule
});
```

There is nothing to call directly in this package unless you are writing an engine; depend on it for the types and the contract.

## Install

``` shell
npm install @shexjs/eval-validator-api
```

---

`@shexjs/eval-validator-api` is one of the [shex.js](https://github.com/shexjs/shex.js#readme) packages; installing [`shex`](https://www.npmjs.com/package/shex) pulls in the whole suite, and [its README](https://github.com/shexjs/shex.js/tree/main/packages/shex#the-shexjs-packages) maps them.

---
_Source: https://npm.io/package/@shexjs/eval-validator-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
