Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rudder-json-template-engine

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rudder-json-template-engine

A library for evaluating JSON template expressions.

  • 0.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22
increased by175%
Maintainers
1
Weekly downloads
 
Created
Source

The Customer Data Platform for Developers

Website · Documentation · Community Slack


rudder-json-template-engine

A library to process JSON data using a custom syntax based on javascript and jspath. We thank the jspath authors for their excellent work, as our library is an extension of the original library. We also want to thank IBM team for their work on jsonata, as we have taken several ideas from the library. You can also consider our library as an alternative to jsonata.

Overview

This library generates a javascript function code from the template and then uses the function to evaluate the JSON data. It outputs the javascript code in the following stages:

  1. Lexing (Tokenization)
  2. Parsing (AST Creation)
  3. Translation (Code generation)

Engine class abstracts the above steps and provides a convenient way to use the json templates to evaluate the inputs.

Features

  1. Variables
  2. Arrays
  3. Objects
  4. Functions
  5. Bindings
  6. Paths
  7. Conditions
  8. Math operations
  9. Logical operations

For more examples, refer Scenarios

Syntax

Getting started

npm install rudder-json-template-engine

const engine = new JsonTemplateEngine(`'Hello ' + .name`);
engine.evaluate({name: 'World'});

Testing

npm test

Contribute

We would love to see you contribute to RudderStack. Get more information on how to contribute here.

License

The RudderStack rudder-json-template-engine is released under the MIT License.

Keywords

FAQs

Package last updated on 01 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc