← Back to Skills Marketplace
openlark

Picomatch — A fast and accurate glob pattern matching library.

by OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
99
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install picomatch
Description
Picomatch — A fast and accurate glob pattern matching library.
README (SKILL.md)

Picomatch

A blazing fast, zero-dependency JavaScript glob pattern matching library, supporting standard and extended Bash glob features.

Trigger Scenarios

Use when the user needs file path matching, glob wildcards (*, **, ?, [...]), .gitignore-style exclusion rules, build tool file filtering, CLI path filtering, file watcher allow/deny lists, etc. Trigger keywords: picomatch, glob matching, .js, **/.ts, wildcards, .gitignore pattern matching, file filtering, minimatch alternative.

Installation

npm install picomatch

Core API

picomatch(glob[, options]) → matcher

Main entry point: Takes a glob pattern and returns a matcher function.

const pm = require('picomatch');
const isMatch = pm('*.js');

isMatch('a.js');  // true
isMatch('a.md');  // false
isMatch('a/b.js'); // false (* does not cross /)

picomatch.isMatch(string, patterns[, options])

Directly checks if a string matches any pattern, without manually calling a matcher.

picomatch.isMatch('a.a', ['b.*', '*.a']); // true
picomatch.isMatch('a.a', 'b.*');          // false

picomatch.matchBase(input, glob)

Matches only the basename of a path (ignores directories).

picomatch.matchBase('foo/bar.js', '*.js');  // true

picomatch.scan(input[, options])

Parses a glob pattern into a structured object.

picomatch.scan('!./foo/*.js', { tokens: true });
// { prefix: '!./', base: 'foo', glob: '*.js', negated: true, tokens: [...] }

picomatch.parse(pattern[, options]) → state

Converts a glob to an intermediate state object, which can be used with .compileRe / .makeRe.

picomatch.makeRe(pattern[, options]) → RegExp

Directly converts a glob to a RegExp.

picomatch.makeRe('*.js');  // /^(?:(?!\.)(?=.)[^/]*?\.js)$/

picomatch.toRegex(source[, options]) → RegExp

Creates a RegExp from a regex source string.

Common Options

Option Type Description
dot boolean Allow matching dotfiles, default false
nocase boolean Case-insensitive matching
matchBase boolean Match against basename only
noglobstar boolean Disable ** matching nested directories
noextglob boolean Disable extglob (+(a|b))
nobrace boolean Disable brace expansion ({a,b})
globstar boolean Treat single * as globstar (bash option)
windows boolean Support Windows backslash paths
ignore array Exclusion list (blacklist)
onMatch function Callback on match success
onIgnore function Callback on ignore
onResult function Callback on all results

Glob Syntax Quick Reference

Syntax Description
* Match any character (excluding /, excluding dotfiles)
** Match any character, including path separators
? Match a single character
[abc] Match any character within brackets
{a,b} Match a or b (brace expansion)
+(a|b) Extglob: match one or more times
!(pattern) Exclude matches
! prefix Negated pattern

Practical Pattern Examples

const pm = require('picomatch');

// JS/TS files
pm('**/*.{js,ts,mjs}');

// Ignore node_modules
pm('**', { ignore: 'node_modules/**' });

// Specific extension with subdirectories
pm('src/**/*.md');

// Dotfiles (hidden files)
pm('.*', { dot: true });

// Case-insensitive (Windows/macOS)
pm('*.JPG', { nocase: true });

// Windows paths
pm('src\\**\\*.js', { windows: true });

Common Use Cases

  • File watcher allow/deny lists — glob filtering for watchman / chokidar
  • .gitignore parsing — parsing ignore pattern lists
  • CLI path filtering — underlying engine for glob / fast-glob
  • Build artifact matching — determining if a file belongs to dist output
  • minimatch alternative — similar API but better performance (micromatch ecosystem)

Detailed Reference

For complete API signatures, option descriptions, scan options, and option examples, see references/api_reference.md.

Usage Guidance
Treat this review as incomplete: the scanner could not read metadata.json or artifact files in the workspace, so no concrete risk evidence was available to assess.
Capability Assessment
Purpose & Capability
Unable to evaluate purpose and capability coherence from artifacts because filesystem inspection failed with a sandbox execution error.
Instruction Scope
Unable to evaluate instruction scope from SKILL.md or related files because the artifacts could not be read.
Install Mechanism
Unable to evaluate install mechanism from metadata or install specs because the workspace commands failed.
Credentials
Unable to compare requested environment access against the skill purpose without artifact contents.
Persistence & Privilege
No artifact-backed persistence or privilege concern was confirmed, but the relevant files could not be inspected.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install picomatch
  3. After installation, invoke the skill by name or use /picomatch
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of the Picomatch skill. - Provides concise documentation and trigger scenarios for glob pattern matching tasks. - Includes installation instructions and a detailed overview of the core API. - Lists common options, glob syntax, and practical usage examples. - Outlines typical use cases and references further documentation.
Metadata
Slug picomatch
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 1
Frequently Asked Questions

What is Picomatch — A fast and accurate glob pattern matching library.?

Picomatch — A fast and accurate glob pattern matching library. It is an AI Agent Skill for Claude Code / OpenClaw, with 99 downloads so far.

How do I install Picomatch — A fast and accurate glob pattern matching library.?

Run "/install picomatch" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Picomatch — A fast and accurate glob pattern matching library. free?

Yes, Picomatch — A fast and accurate glob pattern matching library. is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Picomatch — A fast and accurate glob pattern matching library. support?

Picomatch — A fast and accurate glob pattern matching library. is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Picomatch — A fast and accurate glob pattern matching library.?

It is built and maintained by OpenLark (@openlark); the current version is v1.0.0.

💬 Comments