{"library":"micromatch","title":"Micromatch Glob Matching Utility","description":"Micromatch is a comprehensive and highly performant JavaScript utility for glob matching, serving as a faster and more feature-rich alternative to older libraries like minimatch and multimatch. The current stable version is 4.0.8, actively maintained with regular updates to address bug fixes and security vulnerabilities. Key differentiators include its speed and extensive support for the Bash 4.3 specification, often surpassing Bash itself in terms of adherence to its glob test suite. It is widely adopted across the JavaScript ecosystem for file system operations, build tooling, and configuration management, providing a robust solution for pattern matching in both Node.js and browser environments.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install micromatch"],"cli":null},"imports":["import micromatch from 'micromatch';","import micromatch from 'micromatch';\nmicromatch.isMatch('file.js', '*.js');","import micromatch from 'micromatch';\n// Type definitions are available via @types/micromatch"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import micromatch from 'micromatch';\n\n// Basic usage: filter a list of strings against glob patterns\nconst files = ['foo.txt', 'bar.js', 'baz.md', 'qux.ts', 'image.png'];\nconst jsAndMdFiles = micromatch(files, ['*.js', '*.md']);\nconsole.log('Matching .js and .md files:', jsAndMdFiles); // => ['bar.js', 'baz.md']\n\n// Using negation to exclude patterns\nconst allButJsFiles = micromatch(files, ['*', '!*.js']);\nconsole.log('All files except .js:', allButJsFiles); // => ['foo.txt', 'baz.md', 'qux.ts', 'image.png']\n\n// Boolean matching for a single string\nconst isSourceFile = micromatch.isMatch('src/index.ts', ['src/**/*.ts', 'src/**/*.tsx']);\nconsole.log('Is src/index.ts a source file?', isSourceFile); // => true\n\nconst isConfigFile = micromatch.isMatch('config.json', '**/config.json');\nconsole.log('Is config.json a config file?', isConfigFile); // => true","lang":"typescript","description":"This quickstart demonstrates basic glob matching, filtering lists of strings, using negation patterns, and performing boolean checks with micromatch. It covers common scenarios like selecting files by extension or excluding specific types, showcasing the flexibility of its API.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}