← 返回 Skills 市场
openlark

Picomatch — A fast and accurate glob pattern matching library.

作者 OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
99
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install picomatch
功能描述
Picomatch — A fast and accurate glob pattern matching library.
使用说明 (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.

安全使用建议
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install picomatch
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /picomatch 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug picomatch
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Picomatch — A fast and accurate glob pattern matching library. 是什么?

Picomatch — A fast and accurate glob pattern matching library. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。

如何安装 Picomatch — A fast and accurate glob pattern matching library.?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install picomatch」即可一键安装,无需额外配置。

Picomatch — A fast and accurate glob pattern matching library. 是免费的吗?

是的,Picomatch — A fast and accurate glob pattern matching library. 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Picomatch — A fast and accurate glob pattern matching library. 支持哪些平台?

Picomatch — A fast and accurate glob pattern matching library. 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Picomatch — A fast and accurate glob pattern matching library.?

由 OpenLark(@openlark)开发并维护,当前版本 v1.0.0。

💬 留言讨论