# index-of-any

> Like string indexOf with multiple search strings

Latest version **1.4.5** (published 2023-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install index-of-any
pnpm add index-of-any
yarn add index-of-any
bun add index-of-any
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.5 |
| Published | 2023-06-19 |
| First published | 2019-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | jaspenlind |
| Maintainers | jaspenlind |
| Keywords | nodejs, string, indexOf, index |

## Links

- npm: https://www.npmjs.com/package/index-of-any
- Repository: https://github.com/jaspenlind/index-of-any
- Homepage: https://github.com/jaspenlind/index-of-any#readme
- Issues: https://github.com/jaspenlind/index-of-any/issues
- npm.io page: https://npm.io/package/index-of-any

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.1

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 1.4.5 (latest) — 2023-06-19
- 1.4.4 — 2022-04-11
- 1.4.3 — 2022-03-13
- 1.4.2 — 2022-02-13
- 1.4.0 — 2021-09-23
- 1.3.1 — 2020-08-26
- 1.3.0 — 2020-06-11
- 1.2.0 — 2020-03-15
- 1.1.0 — 2019-11-01

## README

# index-of-any

- Like string indexOf with multiple search strings

[![Build Status](https://travis-ci.com/jaspenlind/index-of-any.svg?branch=master)](https://travis-ci.com/jaspenlind/index-of-any)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/5f4453dacba44ee88ada0bed1d51996c)](https://www.codacy.com/gh/jaspenlind/index-of-any/dashboard?utm_source=github.com&utm_medium=referral&utm_content=jaspenlind/index-of-any&utm_campaign=Badge_Grade)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Coverage Status](https://coveralls.io/repos/jaspenlind/index-of-any/badge.svg?branch=master)](https://coveralls.io/r/jaspenlind/index-of-any?branch=master)
![David](https://img.shields.io/david/jaspenlind/index-of-any)
![GitHub](https://img.shields.io/github/license/jaspenlind/index-of-any)
[![npm](https://img.shields.io/npm/v/index-of-any)](https://www.npmjs.com/package/index-of-any)

## Installation

```shell
npm install index-of-any
```

## Usage

### Search strings

```js
import indexOfAny from "index-of-any";

const searchStrings = ["first", "second", "third"];

const [index, searchString] = indexOfAny("a string containing second search string");

==> [20, "second"]
```

### Search arrays

```js
import indexOfAny from "index-of-any";

const strings = ["first", "second", "third"];

const [index, searchString] = indexOfAny(strings, "second");

==> [2, "second"]
```

## Test

```shell
npm test
```

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