# matching-iterator

> glob style matching on iterables

Latest version **2.1.8** (published 2026-08-06) · 0BSD license · 0 weekly downloads

## Install

```sh
npm install matching-iterator
pnpm add matching-iterator
yarn add matching-iterator
bun add matching-iterator
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.8 |
| Published | 2026-08-06 |
| First published | 2020-05-31 |
| Weekly downloads | 0 |
| License | 0BSD |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=26.5.1 |
| Dependencies | 0 |
| Unpacked size | 12.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Maintainers | arlac77 |

## Links

- npm: https://www.npmjs.com/package/matching-iterator
- Repository: https://github.com/arlac77/matching-iterator
- Homepage: https://github.com/arlac77/matching-iterator#readme
- Issues: https://github.com/arlac77/matching-iterator/issues
- npm.io page: https://npm.io/package/matching-iterator

## Recent versions

- 2.1.8 (latest) — 2026-08-06
- 2.1.7 — 2026-03-12
- 2.1.6 — 2026-01-22
- 2.1.5 — 2025-11-26
- 2.1.4 — 2025-05-10
- 2.1.3 — 2024-02-09
- 2.1.2 — 2024-02-08
- 2.1.1 — 2024-02-08
- 2.1.0 — 2024-02-06
- 2.0.12 — 2023-05-13
- 2.0.11 — 2022-12-30
- 2.0.10 — 2022-12-02
- 2.0.9 — 2022-11-25
- 2.0.8 — 2022-08-22
- 2.0.7 — 2022-07-06
- … 14 more at https://npm.io/package/matching-iterator/versions

## README

[![npm](https://img.shields.io/npm/v/matching-iterator.svg)](https://www.npmjs.com/package/matching-iterator)
[![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
[![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
[![bundlejs](https://deno.bundlejs.com/?q=matching-iterator\&badge=detailed)](https://bundlejs.com/?q=matching-iterator)
[![downloads](http://img.shields.io/npm/dm/matching-iterator.svg?style=flat-square)](https://npmjs.org/package/matching-iterator)
[![GitHub Issues](https://img.shields.io/github/issues/arlac77/matching-iterator.svg?style=flat-square)](https://github.com/arlac77/matching-iterator/issues)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Fmatching-iterator%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/matching-iterator/goto)
[![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Known Vulnerabilities](https://snyk.io/test/github/arlac77/matching-iterator/badge.svg)](https://snyk.io/test/github/arlac77/matching-iterator)

# matching-iterator

glob style matching on iterables

# usage

```js
import { matcher } from "matching-iterator";

for await (const r of matcher([
    { name: "a" },{ name: "b" }], "a*", { name: "name" })) {
  console.log(r);
}
```

# API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

*   [matcher](#matcher)
    *   [Parameters](#parameters)
*   [asyncMatcher](#asyncmatcher)
    *   [Parameters](#parameters-1)
*   [compile](#compile)
    *   [Parameters](#parameters-2)

## matcher

Match entries against glob pattern.

### Parameters

*   `entries` **Iterable<([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))>** input
*   `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** filter to apply
*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**  (optional, default `{}`)

    *   `options.name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of the name attribute
    *   `options.caseSensitive` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** defaults to true

Returns **Iterable<([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))>** filtered entries

## asyncMatcher

Match entries against glob pattern.

### Parameters

*   `entries` **Iterable<([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))>** input
*   `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** filter to apply
*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**  (optional, default `{}`)

    *   `options.name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of the name attribute
    *   `options.caseSensitive` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** defaults to true

Returns **AsyncGenerator<([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))>** filtered entries

## compile

*   **See**: <https://stackoverflow.com/questions/869809/combine-regexp>

### Parameters

*   `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))**&#x20;
*   `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

Returns **any** globs copiled into regex

# install

With [npm](http://npmjs.org) do:

```shell
npm install matching-iterator
```

# license

BSD-2-Clause

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