Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/vite"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["vite","dev"], {});
console.log(JSON.stringify(result));From the command line
$ mark vite dev
As data, in a program
{ "$proc": ["vite", "dev"], "input": {} }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"cwd": {
"description": "Working directory containing vite config (default: the current folder)",
"type": "string"
},
"port": {
"description": "Port to run on",
"type": "number"
},
"host": {
"description": "Host to bind to",
"type": "string"
},
"open": {
"description": "Open browser automatically",
"type": "boolean"
}
}
},
"output": {
"type": "object",
"properties": {
"serverId": {
"type": "string",
"description": "The id of the server: vite.stop takes it"
},
"url": {
"type": "string",
"description": "The URL of the server"
},
"pid": {
"type": "number",
"description": "The process id of vite"
}
},
"required": [
"serverId",
"url",
"pid"
],
"additionalProperties": {}
}
}