# superfilter

> Super recursive dynamic filter function with 0 dependencies.

Latest version **0.1.8** (published 2016-11-09) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2016-11-09 |
| First published | 2016-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Cole Chamberlain |
| Maintainers | cchamberlain |

## Links

- npm: https://www.npmjs.com/package/superfilter
- Repository: https://github.com/noderaider/superfilter
- Homepage: https://superfilter.js.org
- Issues: https://github.com/noderaider/superfilter/issues
- npm.io page: https://npm.io/package/superfilter

## Recent versions

- 0.1.8 (latest) — 2016-11-09
- 0.1.7 — 2016-11-09
- 0.1.6 — 2016-10-01
- 0.1.5 — 2016-09-30
- 0.1.4 — 2016-09-30
- 0.1.3 — 2016-09-30
- 0.1.2 — 2016-09-30
- 0.1.1 — 2016-09-30

## README

## superfilter

A function to filter all the things. Utilizes heavy memoization to quickly filter JSON string / object / array data in flexible ways.

[![Build Status](https://travis-ci.org/noderaider/superfilter.svg?branch=master)](https://travis-ci.org/noderaider/superfilter)
[![codecov](https://codecov.io/gh/noderaider/superfilter/branch/master/graph/badge.svg)](https://codecov.io/gh/noderaider/superfilter)

[![NPM](https://nodei.co/npm/superfilter.png?stars=true&downloads=true)](https://nodei.co/npm/superfilter/)

### Install

`npm install -S superfilter`

### Dependencies

**none**

### Usage

```js

import superfilter from 'superfilter'

const data = (
  { foo: 'bar'
  , kung: (
      { fu: (
          { bar: 'foo'
          , fuji: (
              [ 1
              , 2
              , { coo: 'car'
                , __type__: 'something'
                }
              ]
            )
          }
        )
      }
    )
  }
)

const print = _ => console.info(JSON.stringify(_))

print(superfilter(data, 2))
// { kung: { fu: { fuji: [ 2 ] } } }

print(superfilter(data, `x => Object.keys(x).includes('foo')`)
// { foo: 'bar' }

```

### Options

The third parameter an options object to tweak how you filter:


optionName    | type                          | description
------------- |:-----------------------------:| -----------
`filterKeys`  | `undefined`, `Array<string>` | Only keys supplied will be used in filtering values. (`undefined` => filter on all keys)
`walkKeys`    | `undefined`, `Array<string>` | Only keys supplied will be used in recursive traversal. (`undefined` => walk all paths)
`insertMarks` | `undefined`, `boolean`       | Inserts `<mark></mark>` tags around matching text.

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