Diagram
  • Introduction
  • Get Started
    • Hello World
    • Connecting to a DB
    • From a template
  • Concepts
    • Endpoints
    • Algorithm
  • Nodes
    • Bcrypt
    • Code
    • Constant
    • Database
    • EasyDB
    • Firestore
    • If / Then
    • Request
    • Response
    • JWT
    • Mapper
    • MongoDB
    • Stripe
    • Webhook
  • Templates
    • Login
    • Register
    • Get User
  • Resources
    • Dashboard
    • Contact
    • FAQs
Powered by GitBook
On this page
  • General
  • Input
  • Output
  • Use Cases

Was this helpful?

  1. Nodes

Code

PreviousBcryptNextConstant

Last updated 3 years ago

Was this helpful?

General

The Code node is used to perform more complex manipulations in the received data and return back the result.

Input

  • Source: (optional) Receives 0 or more parameters of type Object, String, Number or Boolean. The number of input parameters depends on the number of parameters variables in the code which are denoted as ${...}. Learn more on .

Output

  • Out: Returns an Object, String, Number or Boolean depending on the result of the executed code. The code snippet emulates a Javascript module and supports various module.exports syntax. Learn more on .

The EXPORTED variable can be returned with any of the following:

  1. exports = EXPORTED

  2. module.exports = EXPORTED

  3. EXPORTED

Use Cases

Call an external API parse and process the response.

  • Request (Get) ➡ Webhook ➡ Script ➡ Response (200)

Return a random number.

  • Request (Get) ➡ Script ➡ Response (200)

vm2.run
module.exports