Utilities
Glue workflow stages with a Node.js script
Run a JavaScript file between workflow stages.
overview
What execute-nodejs does
execute-nodejs sits between stages when catalog tools do not line up. Feed it a script FILE, run custom JavaScript, and emit FILE plus FOLDER for the next node.
Operators reach for it to normalize JSON, merge host lists, call an HTTP API, or apply logic the catalog lacks. Wire prior output into the script workspace, transform it, write results out.
Versus jq or gron, this is full Node, not a fixed JSON transform. Prefer those peers for pure reshape jobs. Prefer a Python execution node when the team writes Python instead.
use cases
Where execute-nodejs fits
Reshape data between two tools
Read the output of one stage, transform it in JavaScript to the exact shape the next tool wants, and write it back so two otherwise-incompatible nodes connect cleanly.
Call an external API mid-workflow
Use Node's HTTP client to enrich results from a third-party service, then emit the combined data for downstream nodes to consume.
Apply custom logic the catalog lacks
When no existing tool covers a step, encode the logic as a Node script so the workflow keeps running end to end without manual intervention.
Build a custom report format
Aggregate findings from earlier stages and render them into the exact JSON, CSV, or HTML layout a report or alert step expects.
reference
execute-nodejs inputs and flags
| Name | Type | Flag | Description |
|---|---|---|---|
| script | FILE | · | JavaScript code file to execute. |
Showing key inputs. execute-nodejs exposes 1 inputs in total.
example
Run execute-nodejs
# execute-nodejs: run transform.js against a host list# inputs: script=transform.jsnode transform.js # writes api.example.com and app.example.com linesapi.example.comapp.example.comstaging.example.comdev.example.commail.example.comcdn.example.comvpn.example.comwww.example.comguidance
Choosing execute-nodejs
Use execute-nodejs when a stage needs custom JavaScript, data reshaping, or an API call no catalog tool covers. Prefer jq for pure JSON transforms. Prefer the Python execution node for Python logic.
jq
Purpose-built JSON transform. Prefer it when you only reshape JSON and do not need full Node.
gron
Flattens JSON into greppable lines. Useful for quick filters, not general scripting.
json2html
Fixed JSON-to-HTML render. A narrow transform versus arbitrary Node code.
faq
execute-nodejs questions
related
More Utilities tools
cewl
Spider a URL and return a wordlist for password crackers.
dnsgen
Wordlist and mined-word subdomain permutation.
pup
CSS selectors over HTML, the jq counterpart for markup.
unfurl
Extract chosen URL parts from stdin into clean line lists.
whisper
Speech to txt, vtt, srt, and json from an audio file or folder.
youtube-transcript
Public caption tracks to transcript.txt and results.jsonl.
Run execute-nodejs yourself
Raw data feeds execute-nodejs, which runs a JavaScript file to transform it and writes the reshaped result as a queryable output.
Facts on this page come from the live Trickest tool library.