Registry / devops / glob-path

glob-path

JSON →
library0.4.0jsnpmunverified

A lightweight library for matching and replacing strings using glob patterns. Version 0.4.0 provides a rule-based engine with custom asterisk semantics (****, ***, **, *) and expression-based replacements. It supports path parsing, extensible rules, and callbacks. The package is minimal compared to alternatives like glob or fast-glob, offering a unique replacement syntax using {expressions} and glob array indexing. Suitable for build pipelines or custom path transformations. Release cadence is low; appears to be a niche tool maintained on GitHub.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only; the package does not export a default, use named import

import { Glob } from 'glob-path'

Dynamic import with named import; package is ESM-only

const { Glob } = await import('glob-path')

TypeScript types are not exported; use the class directly

import type { Glob as GlobType } from 'glob-path'

Shows basic rule matching: match any path ending in .txt and redirect to backup/ folder preserving path and basename.

import { Glob } from 'glob-path'; const glob = new Glob(); glob.addRule('**/*.txt', 'backup/{...}/{basename}'); const result = glob.dest('/docs/readme.txt'); // result: 'backup/docs/readme.txt' console.log(result);
Debug
Known footguns
gotchaAsterisk semantics differ from standard glob: **** matches everything, *** matches paths+barename+ext, ** matches paths only, * matches pathname or basename or extname, not segments.
gotchaaddRule with a function callback requires explicit return for matched rules; if a rule returns undefined, processing continues to next rule.
breakingv0.4.0 API uses a constructor (new Glob()) and calls addRule/dest; earlier versions may have different API.
deprecatedThe package's GitHub repository is archived or has no recent updates; may indicate abandonment.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
3
ahrefsbot
2
Resources