← All procedures
fs.copy
Copy file or directory
CLI- Package
- @procedures/fs · README
- Path
["fs","copy"]- CLI
mark fs copy --src <string> --dest <string>- As data
{"$proc":["fs","copy"],"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","copy"], { src: "<src>", dest: "<dest>" });
console.log(JSON.stringify(result));From the command line
$ mark fs copy --src <string> --dest <string>
As data, in a program
{
"$proc": ["fs", "copy"],
"input": { "src": "<src>", "dest": "<dest>" }
}Input
| Field | Type | Required | Default | Description |
|---|
src | string | yes | | Source path |
dest | string | yes | | Destination path |
recursive | boolean | no | true | Copy directories recursively (default: true) |
overwrite | boolean | no | false | Overwrite existing files (default: false) |
Output
| Field | Type | Required | Default | Description |
|---|
src | string | yes | | The source path |
dest | string | yes | | The destination path |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"src": {
"type": "string",
"description": "Source path"
},
"dest": {
"type": "string",
"description": "Destination path"
},
"recursive": {
"default": true,
"description": "Copy directories recursively (default: true)",
"type": "boolean"
},
"overwrite": {
"default": false,
"description": "Overwrite existing files (default: false)",
"type": "boolean"
}
},
"required": [
"src",
"dest"
]
},
"output": {
"type": "object",
"properties": {
"src": {
"type": "string",
"description": "The source path"
},
"dest": {
"type": "string",
"description": "The destination path"
}
},
"required": [
"src",
"dest"
],
"additionalProperties": {}
}
}