← All procedures
fs.watch
The changes of a file or folder, as a stream
CLI- Package
- @procedures/fs · README
- Path
["fs","watch"]- CLI
mark fs watch --path <string>- As data
{"$proc":["fs","watch"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/fs/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["fs","watch"], { path: "<path>" });
console.log(JSON.stringify(result));From the command line
$ mark fs watch --path <string>
As data, in a program
{ "$proc": ["fs", "watch"], "input": { "path": "<path>" } }Input
Output
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The file or folder to watch"
},
"recursive": {
"description": "Also the changes in the subfolders",
"type": "boolean"
}
},
"required": [
"path"
]
},
"output": {
"type": "object",
"properties": {
"event": {
"type": "string",
"enum": [
"rename",
"change"
],
"description": "\"rename\" for a file that appears or goes away, \"change\" for its content"
},
"filename": {
"description": "The name of the file, relative to the path, when the platform gives it",
"type": [
"string",
"null"
]
}
},
"required": [
"event",
"filename"
],
"additionalProperties": {}
}
}