Skip to content
Agents tracked: 492 Releases (7d): 545 Agent status: 1 with issuesSince last limit reset: Claude 9d · Codex 7d For AI agents: Markdown Updated Nov 20, 2026

ignore

Apply .gitignore rules in JavaScript.

UtilitiesNPM

GitHubWebsite

1. License

“to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software”

MIT allows use in paid and closed-source products.

github.com/kaelzhang/node-ignore/blob/master/LICENSE-MIT

From the package registry and GitHub, checked daily; card checked Nov 10, 2026. Tap a verdict to see its source.How we checkedReport an error

What ignore does

ignore is a small free JavaScript library that answers one question: would this .gitignore file leave this file out? Tools use it to skip build folders, installed packages and secret files the same way git does. You give it the rules and a list of file paths; it does not look at your disk itself.

What people build with it

Skip ignored files when packing

Your tool zips or uploads a project and leaves out what the project's .gitignore already excludes, such as builds and secrets.

Your own .ignore file for a tool

Your app or script lets people list files to skip in its own ignore file, written the same way as .gitignore, like ESLint does.

Explain why a file is skipped

Someone asks why a file never shows up; your tool names the exact rule that hides it, as git check-ignore -v does.

Match git's answers exactly

Your tool and git agree on which files count, so nobody sees a file in one place and not the other.

Keep secrets away from an AI helper Idea

Before an AI assistant or code indexer reads a project, drop .env files and folders the project already hides.

ignore popularity

57 / 100
Gid Score, #1151 overall
434M
downloads a week, npm
508
GitHub stars
27
agent projects use it
ignore: downloads per weeknpm, ignore 434,404,652
ignore: GitHub starskaelzhang/node-ignore 508

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How ignore is used

  • ignore is a dependency in 27 of the 6,254 public GitHub projects set up for AI coding agents that we scanned (0.6% of the 4,863 JavaScript/TypeScript ones), #57 of 406 in utilities.
  • Counting the projects our scan samples by dependency (Solana 3,063, Ethereum and EVM 1,777, 3D and games 3,120, agent frameworks and SDKs 13,629), it appears in 127; those are left out of every share on this page.
  • Projects that use it most often also use Model Context Protocol SDK (JavaScript) (74.1%), Zod (85.2%), Vitest (77.8%).

By coding agent

21 projects, 0.6%
16 projects, 0.5%
7 projects, 2.1%
7 projects, 0.3%

Often used with

In 85.2% of its projects
In 77.8% of its projects
In 70.4% of its projects
In 70.4% of its projects
In 66.7% of its projects
In 66.7% of its projects
In 66.7% of its projects

More about ignore

Funding
  • Open Collective: https://opencollective.com/node-ignore

See all

More in Utilities

Alternatives

ignore This page

MITGid 57434M/wk

globby

Pick globby when you also need to find the files on disk, with .gitignore support built in.

minimatch

Pick minimatch for general file-name patterns or .npmignore files, which do not follow .gitignore rules.

pathspec

Pick pathspec when your tool is written in Python and needs gitignore-style matching.

Compare ignore with another tool

Get started

Tell your AI assistant

“Use the npm package ignore (pin ignore@7.0.14) to filter the project's file list by its .gitignore: pass paths relative to the repo root without ./, add a trailing / for folders, and set ignorecase: false to match git on Linux.”

  1. Add the package to your JavaScript project.

    npm i ignore
    

    From github.com/kaelzhang/node-ignore/blob/master/README.md

  2. Create a checker and add rules, either a list or the whole text of a .gitignore file.

    ignore()
    .add(fs.readFileSync(filenameOfGitignore).toString())
    .filter(filenames)
    

    From github.com/kaelzhang/node-ignore/blob/master/README.md

  3. Pass paths relative to the folder of the .gitignore, without a leading ./ or /.

    From github.com/kaelzhang/node-ignore/blob/master/README.md

Mistakes to avoid

ig.ignores('./src/app.js') or ig.ignores('/src/app.js')
ig.ignores('src/app.js'), using path.relative(rootDir, file)

Since 5.0 such paths throw; our run got: path should be a `path.relative()`d string.

ignore({ allowRelative: true }) (the name the upgrade notes use)
ignore({ allowRelativePaths: true })

In 7.0.14 the option is allowRelativePaths; in our run allowRelative still threw.

ig.ignores('config') for a folder rule config/
ig.ignores('config/') with a trailing slash for folders

It never looks at the disk, so a name without a slash counts as a file (our run: false vs true).

Relying on the default on a Linux server
ignore({ ignorecase: false }) or the repository's core.ignorecase value

Default matching ignores case, so *.png also hides Photo.PNG while git on Linux would keep it.

Using minimatch to apply .gitignore rules
Use ignore for .gitignore, minimatch for .npmignore and plain patterns

minimatch does not follow the gitignore rules.

Questions

Can I use it in a paid, closed-source app?

Yes. It is MIT-licensed; keep the copyright and license notice with its files.

Does it work in the browser?

Yes. The code checks for Node.js only to handle Windows paths; our demo ran it in a browser page.

Why does ig.ignores('./src/app.js') throw an error?

Since version 5 paths must be relative and clean. Drop the ./ (path.relative() gives the right form).

Is it exactly the same as git?

Almost. The README lists a few known differences, such as letter case and some non-English characters.

Is it still maintained?

Yes. Version 7.0.14 came out on 23 October 2026.