Modules@robinpath/glob

@robinpath/glob

0.1.0Public

File pattern matching: find files by glob patterns, test matches, expand braces

@robinpath/glob

File pattern matching: find files by glob patterns, test matches, expand braces

Category Functions Auth License

Why use this module?

The glob module lets you:

  • Find files matching a glob pattern
  • Test if a path matches a glob pattern
  • Convert a glob pattern to a regex string
  • Expand brace pattern into array
  • Extract non-glob base directory from pattern

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/glob

Quick Start

No credentials needed — start using it right away:

glob.isMatch "src/index.ts" "**/*.ts"

Available Functions

FunctionDescription
glob.matchFind files matching a glob pattern
glob.isMatchTest if a path matches a glob pattern
glob.toRegexConvert a glob pattern to a regex string
glob.expandExpand brace pattern into array
glob.baseExtract non-glob base directory from pattern
glob.hasMagicCheck if string contains glob characters

Examples

Test if a path matches a glob pattern

glob.isMatch "src/index.ts" "**/*.ts"

Convert a glob pattern to a regex string

glob.toRegex "*.ts"

Expand brace pattern into array

glob.expand "file.{ts,js}"

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/glob";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  glob.isMatch "src/index.ts" "**/*.ts"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/glob
Version0.1.0
LicenseMIT
Unpacked Size4.0 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities