# arr-indexes-of

> Like Array#indexOf but return all indexes

Latest version **2.0.0** (published 2018-06-04) · ISC license · 0 weekly downloads

## Install

```sh
npm install arr-indexes-of
pnpm add arr-indexes-of
yarn add arr-indexes-of
bun add arr-indexes-of
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-06-04 |
| First published | 2016-10-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Shinnosuke Watanabe |
| Maintainers | shinnn |
| Keywords | array, list, index, search, find, multiple |

## Links

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

## Dependencies (1)

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

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2018-06-04
- 2.0.0-0 — 2018-06-02
- 1.0.2 — 2018-06-02
- 1.0.1 — 2016-11-07
- 1.0.0 — 2016-10-03
- 0.0.0 — 2016-10-03

## README

# arr-indexes-of

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

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

```javascript
import arrIndexesOf from 'arr-indexes-of';

arrIndexesOf(['a', 'a', 'a'], 'a'); //=> [0, 1, 2]
arrIndexesOf(['5', 5, 15, 'five', 5], 5); //=> [1, 4]
```

Almost the same module as [indexes-of](https://github.com/dominictarr/indexes-of), but:

* only supports `Array` by design
  * throws `TypeError` when it takes a `String`
* supports optional [`fromIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf#Parameters) parameter

## Installation

[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).

```
npm install arr-indexes-of
```

## API

```javascript
import arrIndexesOf from 'arr-indexes-of';
```

### arrIndexesOf(*array*, *searchValue* [, *fromIndex*])

*array*: `Array`  
*searchValue*:  any type (value to search for)  
*fromIndex*: `integer` (index in the string where to begin searching)  
Return: `Array`

```javascript
arrIndexesOf(['A', 'B', 'C', '-', 'A', 'B', 'C'], 'A'); //=> [0, 4]
arrIndexesOf(['A', 'B', 'C', '-', 'A', 'B', 'C'], 'A', 4); //=> [4]
```

## Related project

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

## License

[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe

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