Skip to main content

Execute JavaScript code.

POST 

/code/javascript

This endpoint runs JavaScript code in a Linux sandbox using the Bun JavaScript runtime. You can return data from the code using a top-level return statement or by setting the global result variable. Logging something to the console has no effect. To import dependencies, use the require function. All dependencies will be automatically downloaded and installed for you, with the exception of native system dependencies. There is a time limit of 180s and a memory limit of 512MB applied to your code, which also includes the dependency download process. One execution of this module costs 50 credits.

Request

Header Parameters

    authorization string

    The API key that can be retrieved from 0codekit.com.

    ipaas string

Bodyrequired

    codestringrequired

    The JavaScript code that will be executed.

    Example: const _ = require('lodash'); return { data: _.chunk(['a', 'b', 'c', 'd'], 2) };
    dependenciesstring[]

    The system dependencies your JavaScript code requires. These will be installed using apk, the Alpine Package manager.

    Example: []

Responses

Success

Schema