Skip to content
HALOWERK

Codewerk

js run

Evaluates a JavaScript script with the input JSON available as global input. The last expression is the result; undefined becomes null. Uses installed quickjs-emscripten 0.32.0 (MIT), with a fresh WASM runtime for every call, a 32 MiB VM heap and a 500 ms interrupt deadline. The worker runs as a fresh unprivileged DynamicUser in an empty, read-only rootfs with only runtime files mounted; no application state, credentials, host networking or module loader. systemd enforces 256 MiB total.

POST https://code.halowerk.com/v1/js-run

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
codestringYesSynchronous JavaScript script; its last expression is returned.
inputSee schemaNoOptional JSON value, exposed inside the guest as global input.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "code"
  ],
  "properties": {
    "code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 32000,
      "description": "Synchronous JavaScript script; its last expression is returned."
    },
    "input": {
      "description": "Optional JSON value, exposed inside the guest as global input."
    }
  }
}

Open original schema

Published input example

{
  "code": "input.prices.reduce((sum, price) => sum + price, 0)",
  "input": {
    "prices": [
      12,
      8,
      5
    ]
  }
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’