← All procedures
fs.glob
Find files matching glob pattern
CLI- Package
- @procedures/fs · README
- Path
["fs","glob"]- CLI
mark fs glob --pattern <string>- As data
{"$proc":["fs","glob"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/fs"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["fs","glob"], { pattern: "<pattern>" });
console.log(JSON.stringify(result));From the command line
$ mark fs glob --pattern <string>
As data, in a program
{ "$proc": ["fs", "glob"], "input": { "pattern": "<pattern>" } }Input
| Field | Type | Required | Default | Description |
|---|
pattern | string | yes | | Glob pattern to match |
cwd | string | no | | Working directory (default: process.cwd()) |
absolute | boolean | no | false | Return absolute paths (default: false) |
dot | boolean | no | false | Include dotfiles (default: false) |
ignore | string[] | no | | Glob patterns of the paths to leave out. The search does not enter the folders that they match. |
Output
| Field | Type | Required | Default | Description |
|---|
pattern | string | yes | | The glob pattern |
matches | string[] | yes | | The matching paths, sorted: relative to cwd with "/" separators, or absolute with absolute: true |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"description": "Glob pattern to match"
},
"cwd": {
"description": "Working directory (default: process.cwd())",
"type": "string"
},
"absolute": {
"default": false,
"description": "Return absolute paths (default: false)",
"type": "boolean"
},
"dot": {
"default": false,
"description": "Include dotfiles (default: false)",
"type": "boolean"
},
"ignore": {
"description": "Glob patterns of the paths to leave out. The search does not enter the folders that they match.",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"pattern"
]
},
"output": {
"type": "object",
"properties": {
"pattern": {
"type": "string",
"description": "The glob pattern"
},
"matches": {
"type": "array",
"items": {
"type": "string"
},
"description": "The matching paths, sorted: relative to cwd with \"/\" separators, or absolute with absolute: true"
}
},
"required": [
"pattern",
"matches"
],
"additionalProperties": {}
}
}