# whynot

> Generic VM-based structure matching framework

Latest version **5.0.0** (published 2022-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install whynot
pnpm add whynot
yarn add whynot
bun add whynot
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2022-06-23 |
| First published | 2017-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 129.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Stef Busking |
| Maintainers | bwrrp, drrataplan |
| Keywords | Language, Matching, Regex, Structure |

## Links

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

## Recent versions

- 5.0.0 (latest) — 2022-06-23
- 4.0.1 — 2022-06-17
- 4.0.0 — 2021-02-07
- 3.0.3 — 2019-11-08
- 3.0.2 — 2019-05-31
- 3.0.1 — 2019-01-25
- 3.0.0 — 2019-01-15
- 2.0.1 — 2018-11-07
- 2.0.0 — 2018-09-06
- 1.0.0 — 2017-05-18

## README

# whynot.js

[![NPM version](https://badge.fury.io/js/whynot.svg)](https://badge.fury.io/js/whynot)
[![CI](https://github.com/bwrrp/whynot.js/workflows/CI/badge.svg)](https://github.com/bwrrp/whynot.js/actions?query=workflow%3ACI)

Generic VM-based formal language matching framework, inspired by [http://swtch.com/~rsc/regexp/](http://swtch.com/~rsc/regexp/)

This library implements a VM able to execute programs aimed at matching
formal languages. It does so by considering all possible branches in
parallel. This could be used to efficiently implement many types of language
matching, including regular expressions and XML schemas. Furthermore, the
program could be set up to record its progress through both the input and the
language's grammar. This enables giving feedback on _why_ a given input does
not match the grammar rules in some way.

For an example showing how this library can be used, see
[Examples.tests.ts](https://github.com/bwrrp/whynot.js/blob/main/test/Examples.tests.ts)
in the test suite.

## Benchmarking

A simple benchmark is included in the `performance` directory. This script runs a simple program
including repetition and records on an input of 1000000 items. These can be run using
[fonto-benchmark-runner commands](https://www.npmjs.com/package/@fontoxml/fonto-benchmark-runner)
which will run the benchmarks in the console. You can see the benchmark results in
the console output.

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