glob
Match files using shell-style patterns — the most widely used glob implementation in JavaScript.
glob
General JSMatch files using shell-style patterns — the most widely used glob implementation in JavaScript.
Fit
Bundle (gzip)
24.8 kB
81.7 kB raw
Install size includes transitive dependencies. Bundle size is gzipped browser payload.
Freshness
The Problem
Finding files that match a pattern like src/**/*.test.js by manually walking directories with fs is verbose, and getting recursion, ignores, and cross-platform path handling right is surprisingly hard.
What It Does
glob resolves shell-style wildcard patterns into file paths, with support for ** recursion, ignore patterns, and both async and sync APIs. It is the backbone of file discovery in build tools, test runners, and CLIs.
Installation
npm install globUsage Example
import { glob } from "glob";
const testFiles = await glob("src/**/*.test.js", {
ignore: "node_modules/**",
});
console.log(`Found ${testFiles.length} test files`);Related packages
Unified TypeScript SDK for building AI-powered apps — switch between 20+ LLM providers without rewriting code.
animejsGeneral JSLightweight JavaScript animation library with a tiny footprint and a powerful, expressive API.
AOSGeneral JSAn easy-to-use library that makes elements fade, slide, or zoom into view as the user scrolls down your page.
archiverGeneral JSStreaming interface for generating ZIP and TAR archives in Node.js — create compressed archives programmatically from files, directories, and buffers.
@formkit/auto-animateGeneral JS> Add smooth transitions to any element with a single line — zero-config animations for adds, removes, and moves.