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","hash"], { path: "<path>" });
console.log(JSON.stringify(result));From the command line
$ mark fs hash --path <string>
As data, in a program
{ "$proc": ["fs", "hash"], "input": { "path": "<path>" } }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The path of the file"
},
"algorithm": {
"description": "The algorithm (default sha256)",
"type": "string",
"enum": [
"sha256",
"sha512",
"sha1",
"md5"
]
}
},
"required": [
"path"
]
},
"output": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The path of the file"
},
"algorithm": {
"type": "string",
"enum": [
"sha256",
"sha512",
"sha1",
"md5"
],
"description": "The algorithm"
},
"hash": {
"type": "string",
"description": "The hash, as hexadecimal text"
},
"size": {
"type": "number",
"description": "The bytes of the file"
}
},
"required": [
"path",
"algorithm",
"hash",
"size"
],
"additionalProperties": {}
}
}