# and-or-not

> Complex filters as functions and data

Latest version **2.1.0** (published 2017-01-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install and-or-not
pnpm add and-or-not
yarn add and-or-not
bun add and-or-not
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2017-01-21 |
| First published | 2017-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Greg Skiano |
| Maintainers | skiano |
| Keywords | Filter |

## Links

- npm: https://www.npmjs.com/package/and-or-not
- Repository: https://github.com/skiano/and-or-not
- Homepage: https://github.com/skiano/and-or-not#readme
- Issues: https://github.com/skiano/and-or-not/issues
- npm.io page: https://npm.io/package/and-or-not

## Recent versions

- 2.1.0 (latest) — 2017-01-21
- 2.0.12 — 2017-01-15
- 2.0.11 — 2017-01-15
- 2.0.10 — 2017-01-15
- 2.0.9 — 2017-01-14
- 2.0.8 — 2017-01-14
- 2.0.7 — 2017-01-14
- 2.0.6 — 2017-01-14
- 2.0.5 — 2017-01-14
- 2.0.4 — 2017-01-14
- 2.0.3 — 2017-01-14
- 2.0.2 — 2017-01-14
- 2.0.1 — 2017-01-14
- 2.0.0 — 2017-01-14
- 1.0.2 — 2017-01-14
- … 2 more at https://npm.io/package/and-or-not/versions

## README

# and-or-not

### Example

The following code creates a predicate that returns true for numbers less than 15, and not less than 5, and divisible by either 2 or 3.

```javascript
import { and, or, not } from 'and-or-not';
import { $lt, $mod } from 'and-or-not';

const predicate = and($lt(15), 
                      not($lt(5)),
                      or($mod(2), $mod(3)));

const values = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20];

const matches = values.filter(predicate);
  
console.log(matches) // [6,8,9,10,12,14]
```

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