ignore

A pure JavaScript manager, filter, and parser for .gitignore-style rules, built exactly to the gitignore spec.

Library
npm
v7.0.6
498stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
58/100Fair
Development Activity48
Maintenance40
Community64
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture82
Code Quality88
Innovation78
Learning Curve90

ignore is a standalone library that implements the .gitignore matching spec in pure JavaScript, with no dependency on the filesystem or on git itself. You feed it a set of pattern strings — the same syntax used in .gitignore files, including negation, directory-only rules, and glob wildcards — and it tells you which of an array of pathnames should be excluded, matching git check-ignore output.

Because it never touches the disk or shells out to git, ignore works identically in Node.js scripts, bundlers, and any environment where you already have a list of candidate paths (for example, from glob) and need to filter them the way git, ESLint, or npm’s .npmignore-adjacent tooling would. It is the pattern-matching engine underneath several well-known JavaScript dev tools.

What You Get

  • An Ignore manager built with ignore() that accepts one or many patterns via .add(), including the full text of a .gitignore file at once
  • .filter(paths) and .createFilter() to filter an array of pathnames or produce an Array.prototype.filter-compatible predicate
  • .ignores(pathname) for a simple boolean check and .test(pathname) for a detailed {ignored, unignored, rule} result
  • .checkIgnore(pathname), a git check-ignore -v-equivalent debug method that reports which specific rule matched
  • Correct handling of Windows-style backslash paths, case-insensitive matching options, and pattern mark metadata for tracing a rule back to its source line
  • Bundled TypeScript type definitions (index.d.ts) with no separate @types package needed

Common Use Cases

  • Filtering a file list produced by glob or fast-glob down to only the files a tool should actually process, honoring the project’s .gitignore
  • Implementing .eslintignore/.prettierignore-style ignore-file support inside a custom linter, formatter, or build tool
  • Re-implementing git check-ignore behavior in JavaScript for editors, file watchers, or CI tooling that needs to explain why a path is excluded
  • Building higher-level utilities (like glob-gitignore) that combine glob matching with gitignore-aware filtering

Under The Hood

Architecture — The whole library lives in a single index.js (~790 lines, no runtime dependencies) built around three classes: IgnoreRule compiles one gitignore pattern into a lazily-built RegExp (separate regexes for plain ignores() checks versus checkIgnore() debug checks), RuleManager accumulates IgnoreRule instances and exposes .test(path), and Ignore is the public-facing manager returned by the ignore() factory, wrapping a RuleManager per case-sensitivity mode. Pattern compilation walks the raw string character-by-character (makeRegexPrefix) to translate gitignore glob syntax — **, single *, character ranges, escaped !/# — into an equivalent regex fragment, so matching at query time is just a regex test rather than repeated string parsing.

Tech Stack — Pure JavaScript (95% JS, 5% TypeScript in the bundled index.d.ts) with zero production dependencies. The build pipeline uses Babel (@babel/cli/@babel/preset-env) to emit a legacy.js for pre-ES6 Node targets, ESLint (eslint-config-ostai) for linting, and tap for the test runner. TypeScript consumers get types directly from the shipped .d.ts file — no separate @types/ignore package exists or is needed.

Code Quality — The test suite spans three files (ignore.test.js, others.test.js, git-check-ignore.test.js, ~560 lines) plus a fixtures/ directory, and CI (.github/workflows/nodejs.yml) runs the full suite across Ubuntu, Windows, and macOS on Node 20, plus dedicated test:ts and test:16 jobs for module-resolution edge cases (CJS/ESM/Node16). The README states results are cross-checked against real git check-ignore output for correctness, and the project maintains its own CHANGELOG.md with explicit upgrade guides between major versions (4.x→5.x, etc.).

API Design — The API is deliberately minimal: ignore().add(patterns) returns this for chaining, and querying is a choice between .ignores() (boolean), .filter()/.createFilter() (array/predicate), .test() (structured result), and .checkIgnore() (git-parity debug result with the matching rule). Getting started requires no configuration — ignore().add(['*.log']).ignores('debug.log') is a complete example — though the strict path.relative()-only pathname convention (throwing on ./foo or absolute paths unless allowRelativePaths is set) is a sharp edge documented prominently in the README to head off the most common misuse.

Used by 25 apps in this directory

JavaScript
95%
MIT

AnythingLLM

Developer Tools · Automation · AI Assistants

64,914

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
91
Repo Health
78
Technical
68
Dependency
Built with
JavaScript95%
Updated today
TypeScript
99%
Other

byterover-cli

AI Agents · AI Code Assistants

4,941

A portable memory layer for AI coding agents — curate structured project knowledge into a version-controlled context tree that syncs across tools, machines, and teammates.

View details
77
Repo Health
83
Technical
71
Dependency
Built with
TypeScript99%
Updated 1 months ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
72%
MIT

Claude Context

AI Code Assistants

12,417

An MCP server and VS Code extension by Zilliz that turns your entire codebase into semantically searchable context for Claude Code, Cursor, and Gemini CLI, using vector embeddings and Merkle-tree change detection.

View details
55
Repo Health
71
Technical
72
Dependency
Built with
TypeScript72%
Python13%
JavaScript11%
Updated 1 months ago
TypeScript
97%
Apache 2.0

Cline

AI Code Assistants

66,453

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
67
Dependency
Built with
TypeScript97%
Updated today
TypeScript
98%
Apache 2.0

Codebuff

AI Code Assistants

9,981

An open-source AI coding assistant that coordinates specialized agents to edit your codebase from natural language — including Freebuff, a free, ad-supported version powered entirely by open-source models like DeepSeek and Kimi.

View details
84
Repo Health
71
Technical
68
Dependency
Built with
TypeScript98%
Updated today
C
89%
MIT

codegraph

Developer Tools · AI Code Assistants

67,011

A pre-indexed code knowledge graph that cuts AI tool calls by 58% and token costs by 16% — auto-syncing, 100% local, works with Claude Code, Cursor, Codex, and more.

View details
81
Repo Health
85
Technical
73
Dependency
Built with
C89%
Updated 1 weeks ago
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,633

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
65
Repo Health
76
Technical
63
Dependency
Built with
JavaScript90%
Updated 1 months ago
TypeScript
84%
Apache 2.0

Continue

Developer Tools · AI Development · AI Code Assistants

35,532

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
87
Repo Health
88
Technical
65
Dependency
Built with
TypeScript84%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search