Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/peer"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["server","status"], {});
console.log(JSON.stringify(result));From the command line
$ mark server status
As data, in a program
{ "$proc": ["server", "status"], "input": {} }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"port": {
"description": "The port of the server (default: all servers)",
"type": "integer",
"minimum": 1,
"maximum": 65535
}
}
},
"output": {
"type": "object",
"properties": {
"running": {
"type": "boolean",
"description": "True when a server runs"
},
"pid": {
"description": "The process id of the server",
"type": "number"
},
"port": {
"description": "The port of the server",
"type": "number"
},
"endpoint": {
"description": "The URL of the server",
"type": "string"
},
"transport": {
"description": "The transport of the server",
"type": "string"
},
"startedAt": {
"description": "The start time (ISO 8601)",
"type": "string"
},
"uptime": {
"description": "The time since the start, as text",
"type": "string"
},
"logFile": {
"description": "The log file of the server",
"type": "string"
},
"message": {
"type": "string",
"description": "A message about the result"
}
},
"required": [
"running",
"message"
],
"additionalProperties": {}
}
}