codefmt — back to formatter

make code formatter & beautifier

make code modules run user javascript in a node 20 sandbox. scenario data is available via `input` (key-value pairs mapped in the UI); the module output is whatever you `return`. preinstalled libraries (`moment`, `moment-timezone`, `lodash`) are loaded via `require()`.

make code modules let you run custom javascript (node 20) or python (3.12) inside your scenarios. scenario data arrives as the input global, and whatever you return becomes the module's output.

codefmt beautifies your code by wrapping it in the correct async function before formatting and stripping the wrapper afterward, so you can paste just the module body and get clean, formatted code back. preinstalled libraries like lodash, moment, and moment-timezone are loaded via require().

make's lint rules recognize every global the sandbox injects — input, fetch, process, Buffer, URL, and the timer functions — so you won't see false positives, and real bugs still surface instantly.

frequently asked questions

what is make code?

make code is a make module that lets you run custom javascript (node 20) or python (3.12) inside your scenarios. scenario data is available as the input global, and whatever you return becomes the module's output. codefmt formats both the javascript and python variants.

what globals are available in make code javascript modules?

make code javascript runs in a node 20 sandbox and exposes input (the scenario data mapped in the UI), console, fetch, process, Buffer, URL, setTimeout, setInterval, clearTimeout, and clearInterval. libraries like lodash, moment, and moment-timezone are preinstalled and available via require(). codefmt recognizes all of these as valid globals.

does make code support python?

yes. make code supports python 3.12 in the same module. the python runtime exposes input as the scenario data global, and you return a dict to send output back to make. codefmt has a dedicated python formatter (ruff) and will wrap your code correctly so ruff can parse a bare return statement.

can I use async/await in make code?

yes. make code javascript modules run in an async context, so top-level await works directly. you can also use return at the top level to set the module's output. codefmt wraps your code in the correct async function before formatting and strips the wrapper afterward.

does codefmt lint make code?

yes. codefmt runs oxlint on javascript and ruff on python, with make's injected globals registered so you don't get false positives for input, Buffer, URL, and friends. you get instant diagnostics for undefined variables, unused imports, style issues, and common bug patterns before you paste the code back into make.