# lezer-feel

> Lezer-based FEEL grammar

Latest version **3.0.1** (published 2026-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install lezer-feel
pnpm add lezer-feel
yarn add lezer-feel
bun add lezer-feel
```

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2026-05-19 |
| First published | 2020-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 20.12.0 |
| Dependencies | 3 |
| Unpacked size | 239 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Nico Rehwaldt |
| Maintainers | nikku |

## Links

- npm: https://www.npmjs.com/package/lezer-feel
- Repository: https://github.com/nikku/lezer-feel
- Homepage: https://github.com/nikku/lezer-feel#readme
- Issues: https://github.com/nikku/lezer-feel/issues
- npm.io page: https://npm.io/package/lezer-feel

## Dependencies (3)

- [min-dash](https://npm.io/package/min-dash.md) ^5.0.0
- [@lezer/lr](https://npm.io/package/@lezer/lr.md) ^1.4.10
- [@lezer/highlight](https://npm.io/package/@lezer/highlight.md) ^1.2.3

## Recent versions

- 3.0.1 (latest) — 2026-05-19
- 3.0.0 — 2026-05-12
- 2.5.0 — 2026-05-12
- 2.4.0 — 2026-04-19
- 2.3.2 — 2026-04-13
- 2.3.1 — 2026-03-13
- 2.3.0 — 2026-02-11
- 2.2.1 — 2026-02-09
- 2.2.0 — 2026-01-21
- 2.1.0 — 2025-12-04
- 2.0.0 — 2025-11-29
- 1.9.0 — 2025-10-03
- 1.8.1 — 2025-08-13
- 1.8.0 — 2025-08-13
- 1.7.1 — 2025-08-04
- … 58 more at https://npm.io/package/lezer-feel/versions

## README

# lezer-feel

[![CI](https://github.com/nikku/lezer-feel/actions/workflows/CI.yml/badge.svg)](https://github.com/nikku/lezer-feel/actions/workflows/CI.yml)

This is a [DMN](https://www.omg.org/spec/DMN/) FEEL grammar for the
[Lezer](https://lezer.codemirror.net/) parser system.


## Usage

Parse FEEL to a [`Tree`](https://lezer.codemirror.net/docs/ref/#common.Tree):

```javascript
import {
  parser
} from 'lezer-feel';

// parse <Expression>
parser.parse('foo > 1');
```


#### Choose Dialect

Use `Expression` or `UnaryTests` as a [top node](https://lezer.codemirror.net/docs/ref/#lr.LRParser.topNode) depending on which FEEL dialect you intend to parse:

```javascript
import {
  parser
} from 'lezer-feel';

const unaryParser = parser.configure({
  top: 'UnaryTests'
})

// parse <UnaryTests>
unaryParser.parse('> 100');
```


#### Provide Context

Override the default [context tracker](https://lezer.codemirror.net/docs/ref/#lr.ParserConfig.contextTracker) to enable context sensitive parsing based on inputs:

```javascript
import {
  parser,
  trackVariables
} from 'lezer-feel';

const contextTracker = trackVariables({
  'if foo then bar': 1
});

const contextualParser = parser.configure({
  contextTracker
});

// recognizes <if foo then bar> as a <VariableName>
contextualParser.parse('if foo then bar');
```


## Development

```shell
# build and test
npm run all

# test
npm test

# test (debug)
LOG=fparse:dbg,fparse,context,parse npm test
```

Prefix [individual](./test/expressions.txt) [tests](./test/unary-tests.txt) with a `*` to test them in focus mode:

```markdown
# *ArithmeticExpression (error)

...
```


## Related

* [feelin](https://github.com/nikku/feelin) - Interpreter for the FEEL language
* [feel-playground](https://github.com/nikku/feel-playground) - A visual playground to learn the FEEL language
* [lang-feel](https://github.com/nikku/lang-feel) - Integration into a [CodeMirror](https://codemirror.net/) editor

## License

The code is licensed under an MIT license.

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