{
 "kind": "tool",
 "slug": "minimatch",
 "path": "tools/minimatch/",
 "name": "minimatch",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Utilities",
   "tools/utilities/"
  ]
 ],
 "lead": "Test file paths against wildcard patterns.",
 "chips": [
  {
   "label": "Utilities",
   "path": "tools/utilities/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install minimatch"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/isaacs/minimatch"
  },
  {
   "label": "Website",
   "href": "https://github.com/isaacs/minimatch#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "BlueOak-1.0.0",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Each contributor licenses you to do everything with this software that would otherwise infringe that contributor's copyright in it.",
   "note": "The Blue Oak license grants every use the copyright covers, paid or not.",
   "src": "https://github.com/isaacs/minimatch/blob/main/LICENSE.md"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 20, 2026",
   "note": "Latest GitHub release Nov 10, 2026. ",
   "src": "https://github.com/isaacs/minimatch"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "30 projects",
   "status": "info",
   "sub": "#48 of 408 in its category",
   "note": "Dependency in 30 public GitHub projects set up for AI coding agents that we scanned (0.5%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What minimatch does",
   "parts": [
    {
     "t": "prose",
     "text": "minimatch is a small free JavaScript library that answers one question: does this file path match a pattern like src/**/*.ts or *.{png,jpg}? Your scripts and tools use it to pick, skip or group files by name. It only compares text; listing the files on disk is the job of the glob library, which uses minimatch inside."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Run only the changed tests",
       "text": "From the list of files changed in a pull request, keep only the test files and run just those.",
       "idea": false
      },
      {
       "title": "Keep secrets out of uploads",
       "text": "Before a deploy or backup script uploads a folder, it skips .env files, logs and build output by pattern.",
       "idea": true
      },
      {
       "title": "Skip folders that cannot match",
       "text": "A tool that walks a big folder tree stops going into folders whose path can never fit the pattern.",
       "idea": false
      },
      {
       "title": "Find a file whose name has a star",
       "text": "Match a user's file called report[final]*.pdf by its exact name, without the brackets and star acting as wildcards.",
       "idea": false
      },
      {
       "title": "Accept photos in any letter case",
       "text": "An import tool picks up photo.JPG as well as photo.jpg when the user's rule says *.{png,jpg}.",
       "idea": false
      },
      {
       "title": "Let users set include rules",
       "text": "Your app's settings file takes lines like src/**/*.md, and the app treats only matching files.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "minimatch popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "66",
       "of": "/ 100",
       "l": "Gid Score, #642 overall"
      },
      {
       "n": "1.02B",
       "l": "downloads a week, npm"
      },
      {
       "n": "3,530",
       "l": "GitHub stars"
      },
      {
       "n": "30",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How minimatch is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "minimatch is a dependency in 30 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.6% of the 4,867 JavaScript/TypeScript ones), #48 of 408 in utilities.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 85; those are left out of every share on this page.",
      "The most used alternative in our scan is glob (122 projects).",
      "Projects that use it most often also use Vitest (73.3%), Model Context Protocol SDK (JavaScript) (60.0%), tsx (56.7%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "23 projects, 0.7%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "20 projects, 0.7%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "7 projects, 2.1%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "6 projects, 0.2%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "5 projects, 1.1%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 73.3% of its projects",
       "v": "Vitest",
       "path": "tools/vitest/"
      },
      {
       "l": "In 60.0% of its projects",
       "v": "Model Context Protocol SDK (JavaScript)",
       "path": "tools/modelcontextprotocol/"
      },
      {
       "l": "In 56.7% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "esbuild",
       "path": "tools/esbuild/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "Anthropic SDK",
       "path": "tools/anthropic-ai/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "yaml",
       "path": "tools/yaml/"
      },
      {
       "l": "In 46.7% of its projects",
       "v": "chalk",
       "path": "tools/chalk/"
      },
      {
       "l": "In 46.7% of its projects",
       "v": "Commander",
       "path": "tools/commander/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about minimatch",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/isaacs",
        "23 GitHub sponsors"
       ]
      },
      {
       "title": "More in Utilities",
       "path": "tools/utilities/",
       "items": [
        {
         "text": "clsx",
         "path": "tools/clsx/"
        },
        {
         "text": "date-fns",
         "path": "tools/date-fns/"
        },
        {
         "text": "PyYAML",
         "path": "tools/pyyaml/"
        },
        {
         "text": "uuid",
         "path": "tools/uuid/"
        },
        {
         "text": "yaml",
         "path": "tools/yaml/"
        },
        {
         "text": "js-yaml",
         "path": "tools/js-yaml/"
        },
        {
         "text": "Lodash",
         "path": "tools/lodash/"
        },
        {
         "text": "tqdm",
         "path": "tools/tqdm/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "minimatch",
       "me": true,
       "facts": [
        "BlueOak-1.0.0",
        "Gid 66",
        "1.02B/wk"
       ]
      },
      {
       "name": "picomatch",
       "why": "Pick picomatch when you need a regular expression made from a glob, which minimatch 11 no longer offers.",
       "path": "tools/picomatch/",
       "facts": []
      },
      {
       "name": "micromatch",
       "why": "Pick micromatch when your project already uses it; it is a glob matcher offered as an alternative to minimatch.",
       "path": "tools/micromatch/",
       "facts": []
      },
      {
       "name": "glob",
       "why": "Pick glob when you need the list of matching files on disk rather than a yes or no for one path.",
       "path": "tools/glob/",
       "facts": [
        "BlueOak-1.0.0",
        "Gid 74",
        "557M/wk"
       ]
      }
     ],
     "more": "Compare minimatch with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use the npm package minimatch (pin minimatch@11.0.5, Node.js 20 or 22+) with the named import { minimatch }, forward slashes only in patterns, and { dot: true } where dot files must match; never build patterns from untrusted user input."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add minimatch to a project that runs on Node.js 20, or 22 and newer.",
       "code": null,
       "src": "https://registry.npmjs.org/minimatch/11.0.5"
      },
      {
       "text": "Import the named function and test a path against a pattern.",
       "code": "// hybrid module, load with require() or import\nimport { minimatch } from 'minimatch'\n// or:\n// const { minimatch } = require('minimatch')\n\nminimatch('bar.foo', '*.foo') // true!\nminimatch('bar.foo', '*.bar') // false!\n",
       "src": "https://github.com/isaacs/minimatch/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "import minimatch from 'minimatch'",
       "fix": "import { minimatch } from 'minimatch'",
       "why": "There is no default export since 9.0; in our run the module had no default."
      },
      {
       "dont": "minimatch.makeRe(pattern) or new Minimatch(p).regexp",
       "fix": "Call minimatch(path, pattern) or mm.match(path); if you need a regular expression, use picomatch",
       "why": "Version 11 removed both; in our run makeRe was undefined."
      },
      {
       "dont": "Building a pattern with path.join() on Windows, such as src\\*.ts",
       "fix": "Write patterns with / only, such as src/*.ts",
       "why": "A backslash escapes the next character; in our run src\\*.ts did not match src/app.ts."
      },
      {
       "dont": "Expecting **/* to include .env or .github files",
       "fix": "Pass { dot: true } when dot files must match",
       "why": "Dot files are skipped by default; in our demo .env matched only with { dot: true }."
      },
      {
       "dont": "minimatch(path, req.query.pattern) with a pattern typed by a visitor",
       "fix": "Offer fixed patterns or escape the input with minimatch.escape()",
       "why": "Patterns from untrusted input can make any glob matcher slow or behave unexpectedly."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does it find files on my disk?",
       "a": "No. It only says whether a path string fits a pattern; the glob library uses it to list files.",
       "evidence": {
        "url": "https://github.com/isaacs/minimatch/blob/main/README.md",
        "quote": "This is the matching library used internally by node-glob."
       }
      },
      {
       "q": "Why does import minimatch from 'minimatch' fail?",
       "a": "Since version 9 there is no default export; use import { minimatch } from 'minimatch'.",
       "evidence": {
        "url": "https://github.com/isaacs/minimatch/blob/main/changelog.md",
        "quote": "No default export, only named exports."
       }
      },
      {
       "q": "Where did minimatch.makeRe go?",
       "a": "Version 11 removed makeRe and the regexp property; it now matches each path part without regular expressions.",
       "evidence": {
        "url": "https://github.com/isaacs/minimatch/blob/main/changelog.md",
        "quote": "Remove makeRe(), Minimatch#regexp, and the MMRegExp type."
       }
      },
      {
       "q": "Which wildcard features does it support?",
       "a": "Brace sets like {png,jpg}, extended patterns like +(a|b), ** across folders and POSIX character classes.",
       "evidence": {
        "url": "https://github.com/isaacs/minimatch/blob/main/README.md",
        "quote": "Supports these glob features:"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm minimatch"
  ],
  [
   "Category",
   "Utilities"
  ],
  [
   "License",
   "BlueOak-1.0.0"
  ],
  [
   "Gid Score",
   "65.6"
  ],
  [
   "Rank in category",
   "#48 of 408"
  ],
  [
   "GitHub",
   "isaacs/minimatch"
  ],
  [
   "Last change",
   "Nov 20, 2026"
  ]
 ],
 "good": [
  "Do not turn text typed by your users into patterns; the README warns any glob matcher can be abused that way.",
  "Patterns must use forward slashes, also on Windows; a backslash means the next character is literal.",
  "Files and folders whose names start with a dot are skipped by ** and * unless you turn on the dot option."
 ],
 "checked_line": "Read by AgentGid from 7 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/isaacs.png"
}