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-MIT3. Used by agents' projects
Dependency in 27 public GitHub projects set up for AI coding agents that we scanned (0.4%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
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
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
Often used with
More about ignore
Funding
- Open Collective: https://opencollective.com/node-ignore
Alternatives
ignore This page
Pick globby when you also need to find the files on disk, with .gitignore support built in.
Pick minimatch for general file-name patterns or .npmignore files, which do not follow .gitignore rules.
Pick pathspec when your tool is written in Python and needs gitignore-style matching.
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.”
Add the package to your JavaScript project.
npm i ignoreCreate a checker and add rules, either a list or the whole text of a .gitignore file.
ignore() .add(fs.readFileSync(filenameOfGitignore).toString()) .filter(filenames)Pass paths relative to the folder of the .gitignore, without a leading ./ or /.
Mistakes to avoid
Since 5.0 such paths throw; our run got: path should be a `path.relative()`d string.
In 7.0.14 the option is allowRelativePaths; in our run allowRelative still threw.
It never looks at the disk, so a name without a slash counts as a file (our run: false vs true).
Default matching ignores case, so *.png also hides Photo.PNG while git on Linux would keep it.
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.