For the complete documentation index, see llms.txt. This page is also available as Markdown.

Languages

Learn about Languages in Laminar

Overview

Laminar supports both JavaScript and JQ for writing flow transformations. Each language has its own strengths and use cases.

JavaScript

JavaScript transformations use a simple function pattern:

(payload) => {
  // Access data from previous steps or input
  const { input, step_1 } = payload;
  
  // Perform transformations
  const transformed = {
    // ... transformation logic
  };
  
  // Return result object
  return {
    "data": transformed,
    // Optional Laminar keywords
    "lam.httpRequest": {/*...*/}
  };
}

Advantages

  • Familiar syntax for most developers

  • Rich ecosystem of npm packages

  • Native JSON handling

  • Powerful array/object manipulation

Example Transformation

JQ

JQ is a lightweight, powerful language specifically designed for JSON processing:

Advantages

  • Concise syntax for JSON manipulation

  • Powerful built-in functions

  • Excellent performance for JSON processing

  • Native streaming support

Example Transformation

Choosing a Language

  • Choose JavaScript when:

    • You need complex business logic

    • Your team is more familiar with JavaScript

    • You want to use npm packages

    • You need advanced string/array operations

  • Choose JQ when:

    • You're primarily doing JSON transformation

    • You want concise, readable transformations

    • Performance is critical

    • You're working with streaming data

Last updated

Was this helpful?