# aong-js

> and or not group test

Latest version **1.0.1** (published 2022-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install aong-js
pnpm add aong-js
yarn add aong-js
bun add aong-js
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2022-10-23 |
| First published | 2022-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ailnaf |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2022-10-23
- 1.0.0 — 2022-10-22

## README

# aong
and or not group test

## Getting Started

```sh
npm i aong
```

## Usage

```javascript
import { aong, compile } from 'aong-js'

const source = `k1 AND k2 AND (k3 OR k4) NOT (k5)`
console.log({source})

const rule = compile(source)

console.log(JSON.stringify(rule, null, 2))

const texts = [
    'k1',
    'k1 k2',
    'k1 k2 k3',
    'k1 k2 k4',
    'k1 k2 k3 k5',
]

texts.forEach(text => {
    console.log({text}, aong(rule, text))
})

// { source: 'k1 AND k2 AND (k3 OR k4) NOT (k5)' }
// {
//   "type": "and",
//   "data": [
//     "k1",
//     "k2",
//     {
//       "type": "or",
//       "data": [
//         "k3",
//         "k4"
//       ]
//     },
//     {
//       "type": "not",
//       "data": [
//         "k5"
//       ]
//     }
//   ]
// }
// { text: 'k1' } false
// { text: 'k1 k2' } false
// { text: 'k1 k2 k3' } true
// { text: 'k1 k2 k4' } true
// { text: 'k1 k2 k3 k5' } false

```

## License

MIT

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