Untrusted code execution.

Send JavaScript code alongside with data and retrieve JSON output.

Request
1{
2	"via": "json",
3	"data": {
4		"hello": "world"
5	},
6	"code": "
7		const { quotes } = await import('https://deno.land/x/[email protected]/mod.ts');
8		input['quote'] = quotes[0];
9	"
10}

“data“ is available as input variable in code.

input is auto-returned and available in response.

Response

1{
2	"hello": "world",
3	"quote": "Act only according to that maxim whereby you can, at the same time, will that it should become a universal law. - Immanuel Kant"
4}
Try it yourself using curl
curl --request POST \
  --url https://api.execage.com/run \
  --header 'Content-Type: application/json' \
  --data '{
  "via": "json",
  "data": {
    "hello": "world"
  },
  "code": "const { quotes } = await import('\''https://deno.land/x/[email protected]/mod.ts'\'');input['\''quote'\''] = quotes[0];"
}'

Capabilities

Code is executed inside dockerized sandbox using the Deno runtime. Users have access to network only.

Limited execution time

Execution timeouts after 5 seconds.

Internet access

Untrusted code can access internet.

Dockerized

Code is executed inside a Docker container.

deno icon

Deno runtime

JavaScript is executed using Deno runtime with access to all packages via dynamic import.

Neat!

Keep me updated about where is this going.

build with

❤️ Shoutout to amazing libraries and software!