{
 "kind": "tool",
 "slug": "glob",
 "path": "tools/glob/",
 "name": "glob",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Utilities",
   "tools/utilities/"
  ]
 ],
 "lead": "Find files by pattern in Node.js.",
 "chips": [
  {
   "label": "Utilities",
   "path": "tools/utilities/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install glob"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/isaacs/node-glob"
  },
  {
   "label": "Website",
   "href": "https://github.com/isaacs/node-glob#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 use of the code in any product.",
   "src": "https://github.com/isaacs/node-glob/blob/main/LICENSE.md"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 20, 2026",
   "note": "Latest GitHub release Nov 12, 2026. ",
   "src": "https://github.com/isaacs/node-glob"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "122 projects",
   "status": "info",
   "sub": "#7 of 408 in its category",
   "note": "Dependency in 122 public GitHub projects set up for AI coding agents that we scanned (1.9%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Community skills",
   "status": "info",
   "sub": "1 skills by others",
   "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 glob does",
   "parts": [
    {
     "t": "prose",
     "text": "glob is a free Node.js library that finds files on disk by a pattern, like every .js file under src or all images in two folders. Your script gets back a plain list of file paths to read, copy, check or delete. It uses the same wildcards as the command line."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Collect your project's source files",
       "text": "A build or check script gathers every JavaScript file in the project but stays out of the huge folder of installed packages.",
       "idea": false
      },
      {
       "title": "Gather images from several folders",
       "text": "A script that resizes or uploads pictures picks every png and jpeg from the css and public folders in one call.",
       "idea": false
      },
      {
       "title": "Build pages from Markdown posts",
       "text": "A small static site generator lists every Markdown post in the content folder and turns each into a page.",
       "idea": true
      },
      {
       "title": "Stop a search that takes too long",
       "text": "On a big drive or network share, give the search a time limit so a slow folder cannot hang your tool.",
       "idea": false
      },
      {
       "title": "Include hidden config files",
       "text": "A backup or packaging script also picks up files like .env or .eslintrc that a plain pattern skips.",
       "idea": false
      },
      {
       "title": "Clean up generated files",
       "text": "Before a fresh build, list old reports or temporary files by pattern and delete them in one pass.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "glob popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "74",
       "of": "/ 100",
       "l": "Gid Score, #230 overall"
      },
      {
       "n": "557M",
       "l": "downloads a week, npm"
      },
      {
       "n": "8,711",
       "l": "GitHub stars"
      },
      {
       "n": "122",
       "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 glob is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "glob is a dependency in 122 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.5% of the 4,867 JavaScript/TypeScript ones), #7 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 311; those are left out of every share on this page.",
      "Projects that use it most often also use tsx (50.0%), Husky (39.3%), TypeScript (86.9%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "83 projects, 2.5%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "61 projects, 2.0%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "49 projects, 2.0%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "19 projects, 4.0%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "12 projects, 3.5%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      },
      {
       "l": "11 projects, 2.3%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "6 projects, 1.8%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 50.0% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 39.3% of its projects",
       "v": "Husky",
       "path": "tools/husky/"
      },
      {
       "l": "In 86.9% of its projects",
       "v": "TypeScript",
       "path": "tools/typescript/"
      },
      {
       "l": "In 32.0% of its projects",
       "v": "lint-staged",
       "path": "tools/lint-staged/"
      },
      {
       "l": "In 30.3% of its projects",
       "v": "Express",
       "path": "tools/express/"
      },
      {
       "l": "In 49.2% of its projects",
       "v": "Prettier",
       "path": "tools/prettier/"
      },
      {
       "l": "In 27.0% of its projects",
       "v": "chalk",
       "path": "tools/chalk/"
      },
      {
       "l": "In 32.0% of its projects",
       "v": "Model Context Protocol SDK (JavaScript)",
       "path": "tools/modelcontextprotocol/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about glob",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/isaacs",
        "23 GitHub sponsors"
       ]
      },
      {
       "title": "Agent Skills for it",
       "path": "skills/",
       "items": [
        "glob: Find files by glob pattern recursively. Results sorted by modification time (newest first). Auto-skips .git, node_modules and other common i"
       ]
      },
      {
       "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": "glob",
       "me": true,
       "facts": [
        "BlueOak-1.0.0",
        "Gid 74",
        "557M/wk"
       ]
      },
      {
       "name": "globby",
       "why": "Pick globby when your patterns are simple and you want .gitignore rules respected automatically; glob's README names it for that.",
       "path": "tools/globby/",
       "facts": []
      },
      {
       "name": "fast-glob",
       "why": "Pick fast-glob when patterns are simple and raw speed of a sync search matters most, as glob's own README suggests.",
       "path": "tools/fast-glob/",
       "facts": []
      },
      {
       "name": "tinyglobby",
       "why": "Pick tinyglobby when you want a small library for everyday patterns with few dependencies.",
       "path": "tools/tinyglobby/",
       "facts": []
      }
     ],
     "more": "Compare glob with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use glob (pin glob@14.0.4, Node.js 20+) with `import { glob } from \"glob\"` to list the project's files by pattern; always pass ignore: \"node_modules/**\", use forward slashes in patterns, and sort the result."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Install the package named glob (not node-glob, which is a different, abandoned package).",
       "code": "npm i glob",
       "src": "https://github.com/isaacs/node-glob/blob/main/README.md"
      },
      {
       "text": "Import the functions by name and await the list of matches.",
       "code": "// load using import\nimport { glob, globSync, globStream, globStreamSync, Glob } from 'glob'\n\n// all js files, but don't look in node_modules\nconst jsfiles = await glob('**/*.js', { ignore: 'node_modules/**' })\n",
       "src": "https://github.com/isaacs/node-glob/blob/main/README.md"
      },
      {
       "text": "Need it on the command line? The command moved to its own package in version 13.",
       "code": "npm install glob-bin",
       "src": "https://github.com/isaacs/node-glob/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "glob('**/*.js', (err, files) => ...) or import glob from 'glob', copied from answers written for glob 7",
       "fix": "const { glob, globSync } = require('glob') (or import { glob } from 'glob'), then await glob(pattern)",
       "why": "Version 9 moved to promises and named exports; the ESM build has no default export (our run: typeof default was undefined)."
      },
      {
       "dont": "glob('**/*.js') in a project root",
       "fix": "glob('**/*.js', { ignore: 'node_modules/**' })",
       "why": "Nothing is skipped by default; our demo returned node_modules/left-pad/index.js until ignore was set."
      },
      {
       "dont": "Building a pattern with path.join on Windows, e.g. 'src\\\\*.js'",
       "fix": "Write patterns with forward slashes ('src/*.js'), or set windowsPathsNoEscape: true",
       "why": "A backslash is an escape in patterns; in our run 'src\\\\*.js' found nothing and found src/app.js with windowsPathsNoEscape."
      },
      {
       "dont": "Trusting the order of results (first file = oldest, or alphabetical)",
       "fix": "Sort the list yourself, or use stat: true with withFileTypes and sort by mtimeMs",
       "why": "The walk happens in no fixed order."
      },
      {
       "dont": "npx glob '**/*.md' expecting the command line tool",
       "fix": "Install glob-bin for the command, keep glob for code",
       "why": "The command left the main package in version 13."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Does it skip node_modules on its own?",
       "a": "No. Pass ignore: \"node_modules/**\"; in our demo **/*.js returned node_modules files until we did.",
       "evidence": {
        "url": "https://github.com/isaacs/node-glob/blob/main/README.md",
        "quote": "all js files, but don't look in node_modules"
       }
      },
      {
       "q": "What happens when nothing matches?",
       "a": "You get an empty list, unlike a shell, which prints the pattern itself.",
       "evidence": {
        "url": "https://github.com/isaacs/node-glob/blob/main/README.md",
        "quote": "If no matching files are found, then an empty array is returned."
       }
      },
      {
       "q": "Where did the glob command go?",
       "a": "Since version 13 it lives in the separate glob-bin package.",
       "evidence": {
        "url": "https://github.com/isaacs/node-glob/blob/main/README.md",
        "quote": "The glob CLI has been moved to the glob-bin package, and must be installed separately, as of version 13."
       }
      },
      {
       "q": "Why does my old callback code fail?",
       "a": "Version 9 replaced callbacks with promises and renamed the exported functions; use await glob(...).",
       "evidence": {
        "url": "https://github.com/isaacs/node-glob/blob/main/changelog.md",
        "quote": "Promise API instead of callbacks."
       }
      },
      {
       "q": "Can I use it in a paid product?",
       "a": "Yes. The Blue Oak license allows it; pass on the license text or link with copies of glob's files.",
       "evidence": {
        "url": "https://github.com/isaacs/node-glob/blob/main/LICENSE.md",
        "quote": "Each contributor licenses you to do everything with this software that would otherwise infringe that contributor's copyright in it."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm glob"
  ],
  [
   "Category",
   "Utilities"
  ],
  [
   "License",
   "BlueOak-1.0.0"
  ],
  [
   "Gid Score",
   "74.1"
  ],
  [
   "Rank in category",
   "#7 of 408"
  ],
  [
   "GitHub",
   "isaacs/node-glob"
  ],
  [
   "Last change",
   "Nov 20, 2026"
  ]
 ],
 "good": [
  "Patterns must use forward slashes, even on Windows. A backslash in a pattern means 'treat the next character literally', not 'folder'.",
  "Results come back in no fixed order, so sort them if the order matters.",
  "On macOS and Windows matching ignores letter case by default; on Linux it does not, so the same pattern can find different files."
 ],
 "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"
}