executejavascript - Execute Javascript Code

Version: 1.0.0
Credits: 5

Execute JavaScript code in a sandbox on our server. The following npm packages can be used: momentjs, cheerio, handlebars, ... (see https://1001fx.com for full list). Exceptions will be caught and returned. Strict is forced and imports are not allowed.
See Blog post for details

Examples:

Using Cheerio library to extract text from an HTML file Using Handlebars library to create HTML templates with dynamic data Using node-fetch library to retrieve data from an external API Using Yup library to validate user input data in a form.

Here are some examples for code:

Hints

  • Remember that you need to return the result that you want to return.
  • Add "const yourVariable = YOUR_INPUT_HERE;" to your script and fill in from previous steps in make.
  • Use our playground to test your code before running it.

Playground

Open playground

executejs.png

Available Packages

CaseNPM PackageURL
axiosaxioshttps://www.npmjs.com/package/axios
cheeriocheeriohttps://www.npmjs.com/package/cheerio
crypto-jscrypto-jshttps://www.npmjs.com/package/crypto-js
handlebarshandlebarshttps://www.npmjs.com/package/handlebars
joijoihttps://www.npmjs.com/package/joi
lodashlodashhttps://www.npmjs.com/package/lodash
momentmomenthttps://www.npmjs.com/package/moment
moment-timezonemoment-timezonehttps://www.npmjs.com/package/moment-timezone
mustachemustachehttps://www.npmjs.com/package/mustache
node-fetchnode-fetchhttps://www.npmjs.com/package/node-fetch
uuiduuidhttps://www.npmjs.com/package/uuid
ulidulidhttps://www.npmjs.com/package/ulid
underscoreunderscorehttps://www.npmjs.com/package/underscore
yupyuphttps://www.npmjs.com/package/yup
zodzodhttps://www.npmjs.com/package/zod
code
Type
string
Required
required
Code to be executed. Has to be valid javascript code. Store result in a variable and just write the variable in a single line at the end to return the value.
Example:
const a = 2; const b = 3;return a * b;

Available on

Postman
Make
Zapier
N8N
Airtable
SeaTable
Bubble
Power Automate
Workato
SAP Build