# @thinql/parse

> Parse ThinQL queries to ASTs

Latest version **0.2.0** (published 2019-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @thinql/parse
pnpm add @thinql/parse
yarn add @thinql/parse
bun add @thinql/parse
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2019-06-11 |
| First published | 2019-06-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 10 |
| Dependencies | 4 |
| Unpacked size | 151.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Matt Miller |
| Maintainers | mmiller42 |
| Keywords | filter, parser, query, reduce, search, thinql |

## Links

- npm: https://www.npmjs.com/package/@thinql/parse
- Repository: https://github.com/mmiller42/thinql
- Issues: https://github.com/mmiller42/thinql/issues
- npm.io page: https://npm.io/package/@thinql/parse

## Dependencies (4)

- [jju](https://npm.io/package/jju.md) ^1.4.0
- [moo](https://npm.io/package/moo.md) ^0.5.0
- [nearley](https://npm.io/package/nearley.md) ^2.16.0
- [memoize-one](https://npm.io/package/memoize-one.md) ^5.0.4

## 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

- 0.2.0 (latest) — 2019-06-11

## README

# @thinql/parse

Parse ThinQL queries to ASTs

## Installation

```sh
# npm
npm install @thinql/parse

# yarn
yarn add @thinql/parse
```

## Example

```js
import assert from 'assert'
import isEqual from 'lodash.isequal'
import parse from '@thinql/parse'

const result = parse('hello world')

assert(result.toString() === 'hello world')

assert(isEqual(result.toJSON(), {
  $type: 'Statement',
  expression: [
    {
      $type: 'LogicalAndExpression',
      assertions: [
        {
          $type: 'Assertion',
          assertion: {
            $type: 'FullTextSearch',
            value: {
              $type: 'Value',
              content: 'hello',
              literal: false,
            },
          },
          negated: false,
        },
        {
          $type: 'Assertion',
          assertion: {
            $type: 'FullTextSearch',
            value: {
              $type: 'Value',
              content: 'world',
              literal: false,
            },
          },
          negated: false,
        },
      ],
    },
  ],
}))
```

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