# fast-filter

> Array filtering faster than the native array.filter method

Latest version **1.0.4** (published 2015-01-15) · 0 weekly downloads

## Install

```sh
npm install fast-filter
pnpm add fast-filter
yarn add fast-filter
bun add fast-filter
```

## 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 | 1.0.4 |
| Published | 2015-01-15 |
| First published | 2015-01-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Matt Dunlap |
| Maintainers | prestaul |
| Keywords | array, filter, performance, fast, shim, polyfill |

## Links

- npm: https://www.npmjs.com/package/fast-filter
- Repository: git@github.com:Prestaul/fast-filter
- Homepage: https://github.com/Prestaul/fast-filter
- Issues: https://github.com/Prestaul/fast-filter/issues
- npm.io page: https://npm.io/package/fast-filter

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

- 1.0.4 (latest) — 2015-01-15
- 1.0.3 — 2015-01-15

## README

# fast-filter

A replacement for the native `[].filter` method that performs [5-10 times faster](http://jsperf.com/fastfilter-vs-native-array-filter) in most environments.

## Install

```bash
npm install fast-filter
```

## Basic usage
```js
var fastFilter = require('fast-filter');

fastFilter([1,2,3,4,5,6], function(val) { return val % 2; }); // [1,3,5]
```

## "Installing" on the Array.prototype
You can add `fastFilter` to the native `Array.prototype` for convienience.
```js
require('fast-filter').install();

[1,2,3,4,5,6].fastFilter(function(val) { return val % 2; }); // [1,3,5]
```

Or provide an alias:
```js
require('fast-filter').install('select');

[1,2,3,4,5,6].select(function(val) { return val % 2; }); // [1,3,5]
```

## Replacing the native `filter` method
You can replace the native `Array.prototype.filter` method, but keep in mind that this will modify the `filter` method for all code in this instance including any required modules and may result in unexpected behavior.
```js
require('fast-filter').install('filter');

[1,2,3,4,5,6].filter(function(val) { return val % 2; }); // [1,3,5]
```

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