# find-indexes

> Like Array#findIndex() but return all indexes

Latest version **1.0.1** (published 2017-05-08) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install find-indexes
pnpm add find-indexes
yarn add find-indexes
bun add find-indexes
```

## 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 | 2017-05-08 |
| First published | 2016-12-20 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | array, index, search, find, all, test, satisfy, multi, multiple |

## Links

- npm: https://www.npmjs.com/package/find-indexes
- Repository: https://github.com/shinnn/find-indexes
- Homepage: https://github.com/shinnn/find-indexes#readme
- Issues: https://github.com/shinnn/find-indexes/issues
- npm.io page: https://npm.io/package/find-indexes

## Dependencies (1)

- [append-type](https://npm.io/package/append-type.md) ^1.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-05-08
- 1.0.0 — 2016-12-20
- 0.0.0 — 2016-12-20

## README

# find-indexes

[![NPM version](https://img.shields.io/npm/v/find-indexes.svg)](https://www.npmjs.com/package/find-indexes)
[![Bower version](https://img.shields.io/bower/v/find-indexes.svg)](https://github.com/shinnn/find-indexes/releases)
[![Build Status](https://travis-ci.org/shinnn/find-indexes.svg?branch=master)](https://travis-ci.org/shinnn/find-indexes)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/find-indexes.svg)](https://coveralls.io/r/shinnn/find-indexes)

Like [`Array#findIndex()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex), but return all indexes instead of the first one

```javascript
import findIndexes from 'find-indexes';

findIndexes(['a', 'b', 'c', 'b'], val => val === 'b'); //=> [1, 3]
```

## Installation

### [npm](https://www.npmjs.com/)

```
npm install find-indexes
```

### [bower](https://bower.io/)

```
bower install find-indexes
```

## API

```javascript
import findIndexes from 'find-indexes';
```

### findIndexes(*array*, *fn*)

*array*: `Array`  
*fn*: `Function`  
Return: `Array`

It returns all indexes of the the array that satisfy the provided testing function. Otherwise it returns an empty array.

```javascript
findIndexes([0.1, 0.5], Math.ceil); //=> [0, 1]
findIndexes([0.1, 0.5], Math.round); //=> [1]
findIndexes([0.1, 0.5], Math.floor); //=> []
```

## Related projects

* [arr-indexes-of](https://github.com/shinnn/arr-indexes-of) - [`Array#indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf) version
* [str-indexes-of](https://github.com/shinnn/str-indexes-of) - [`String#indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) version

## License

[Creative Commons Zero v1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/deed)

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