← All procedures

client.sqrt

Square root

browsernot registered
Package
@procedures/client · README
Path
["client","sqrt"]
CLI
Not a mark command: it is not in the default registry.
As data
{"$proc":["client","sqrt"],"input":{}}
Tags
core, math

Try it in the Composer →

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY, allCoreProcedures } from "@procedures/client";

for (const procedure of allCoreProcedures) {
  if (!PROCEDURE_REGISTRY.has(procedure.path)) PROCEDURE_REGISTRY.register(procedure);
}

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["client","sqrt"], { value: 1 });
console.log(JSON.stringify(result));

As data, in a program

{ "$proc": ["client", "sqrt"], "input": { "value": 1 } }

Input

FieldTypeRequired
valuenumberyes

Output

The schema does not list fields (number).

JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "value": {
        "type": "number",
        "description": "The value"
      }
    },
    "required": [
      "value"
    ]
  },
  "output": {
    "type": "number",
    "description": "The square root"
  }
}