explaingit

orielhaim/zeromatch

Analysis updated 2026-05-18

4RustAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A Rust-powered glob pattern matcher for Node.js and Bun that is a fast, drop-in replacement for picomatch.

Mindmap

mindmap
  root((zeromatch))
    What it does
      Matches file paths to glob patterns
      Compiles patterns to bytecode
      Batch tests many paths
    Tech stack
      Rust
      Node.js
      Bun
    Use cases
      Speed up build tools
      Filter file lists
      Replace picomatch
    Audience
      Developers
      Tool authors

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Speed up file matching in a build tool, bundler, or file watcher.

USE CASE 2

Replace picomatch in an existing project with minimal code changes.

USE CASE 3

Match many file paths against the same pattern in one batched call.

USE CASE 4

Match raw byte data from the file system without converting it to a string first.

What is it built with?

RustNode.jsBun

How does it compare?

orielhaim/zeromatch6elphegor/warpadoslabsproject-gif/liara-toolkit
Stars444
LanguageRustRustRust
Setup difficultyeasyeasyhard
Complexity2/55/54/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Falls back to compiling from source with a Rust toolchain on unsupported platforms.

Use, modify, and share freely, including for commercial projects, as long as you keep the copyright notice.

In plain English

Zeromatch is a fast pattern matching library for finding files by name patterns, similar to how you might search for all .js files inside a folder using something like src/**/*.js. It is written in Rust for speed but is meant to be used from Node.js and Bun projects, and it aims to be a drop in replacement for a popular existing library called picomatch, so switching to it should not require rewriting your code. The library works by compiling a glob pattern, which is a shorthand way of describing a set of file paths, into a small internal program rather than turning it into a full regular expression. This makes zeromatch especially quick when you compile a pattern once and only need to test it a single time, or when you need to test one pattern against many file paths at once using its batched testMany function. According to the benchmarks in the README, zeromatch is about twice as fast as picomatch in these one shot situations, though picomatch can still be quicker in tight loops where the same pattern is reused thousands of times on one path at a time. Zeromatch can also match directly against raw byte data, such as Buffer or Uint8Array objects that Node.js sometimes returns from file system calls, without first converting that data into a text string. It supports common features like compiled matchers, sets of multiple patterns combined together, and a scan function that breaks a pattern into its base folder and glob portions. Not every feature of picomatch is included. A few callback options are left out because they are rarely used, and one function returns a plain text version of a regular expression rather than a ready to use regex object. The project ships prebuilt binaries for common platforms, and falls back to compiling from source using a Rust toolchain if your platform is not covered. It requires a reasonably recent version of Node.js and is released under the MIT license.

Copy-paste prompts

Prompt 1
Show me how to swap picomatch for zeromatch in my Node.js build tool.
Prompt 2
Help me use zeromatch's testMany function to filter a large list of file paths.
Prompt 3
Write a GlobSet example with zeromatch that excludes node_modules from matches.
Prompt 4
Explain the tradeoffs between zeromatch and picomatch for my use case.

Frequently asked questions

What is zeromatch?

A Rust-powered glob pattern matcher for Node.js and Bun that is a fast, drop-in replacement for picomatch.

What language is zeromatch written in?

Mainly Rust. The stack also includes Rust, Node.js, Bun.

What license does zeromatch use?

Use, modify, and share freely, including for commercial projects, as long as you keep the copyright notice.

How hard is zeromatch to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is zeromatch for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.