Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/json/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["csv","stringify"], { rows: [] });
console.log(JSON.stringify(result));From the command line
$ mark csv stringify --rows <any[]>
As data, in a program
{ "$proc": ["csv", "stringify"], "input": { "rows": [] } }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"rows": {
"type": "array",
"items": {
"description": "A row: an array of fields, or an object of fields by column name"
},
"description": "The rows: all arrays or all objects. A field is a string, a number, a boolean or null"
},
"columns": {
"description": "The names of the columns. For objects, they select the keys and give their order. For arrays, they are the first row",
"type": "array",
"items": {
"type": "string"
}
},
"header": {
"description": "False: no row with the names of the columns (default: true)",
"type": "boolean"
},
"delimiter": {
"description": "The character between two fields (default: a comma)",
"type": "string",
"minLength": 1,
"maxLength": 1
},
"lineBreak": {
"description": "The line break after each row (default: CRLF)",
"type": "string",
"enum": [
"\r\n",
"\n"
]
}
},
"required": [
"rows"
]
},
"output": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "The CSV text"
}
},
"required": [
"text"
],
"additionalProperties": false
}
}