Skip to content

Commit

Permalink
Merge branch 'main' into fix.standard-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
koladilip authored Jun 14, 2024
2 parents f763a67 + a47d40c commit 0a14bda
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.13.1"
".": "0.13.2"
}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.13.2](https://github.com/rudderlabs/rudder-json-template-engine/compare/v0.13.1...v0.13.2) (2024-06-14)


### Bug Fixes

* package.json remove type module ([#93](https://github.com/rudderlabs/rudder-json-template-engine/issues/93)) ([8849705](https://github.com/rudderlabs/rudder-json-template-engine/commit/88497050bf444b49c2b33d203d5d8d34b6f9ba07))

## [0.13.1](https://github.com/rudderlabs/rudder-json-template-engine/compare/v0.13.0...v0.13.1) (2024-06-14)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rudderstack/json-template-engine",
"version": "0.13.1",
"version": "0.13.2",
"homepage": "https://github.com/rudderlabs/rudder-json-template-engine",
"description": "A library for evaluating JSON template expressions.",
"main": "build/index.js",
Expand Down
17 changes: 11 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

## Overview

Welcome to our JSON Template Engine! This powerful tool simplifies transforming JSON data from one format to another, making it easier to manage and maintain complex integrations.
Welcome to our JSON Template Engine! This powerful tool simplifies transforming JSON data from one format to another, making managing and maintaining complex integrations easier.

### Why JSON Template Engine?

Expand Down Expand Up @@ -74,11 +74,11 @@ engine.evaluate({ name: 'World' }); // => 'Hello World'
### Use CDN URL directly in the browser
Latest URL: https://cdn.jsdelivr.net/npm/@rudderstack/json-template-engine/build/json-template.min.js
<!-- x-release-please-start-version -->
Versioned URL: https://cdn.jsdelivr.net/npm/@rudderstack/[email protected].1/build/json-template.min.js
Versioned URL: https://cdn.jsdelivr.net/npm/@rudderstack/[email protected].2/build/json-template.min.js

```html
<script type="module">
import { JsonTemplateEngine } from 'https://cdn.jsdelivr.net/npm/@rudderstack/[email protected].1/build/json-template.min.js';
import { JsonTemplateEngine } from 'https://cdn.jsdelivr.net/npm/@rudderstack/[email protected].2/build/json-template.min.js';
const engine = JsonTemplateEngine.createAsSync(`'Hello ' + .name`);
engine.evaluate({ name: 'World' });
</script>
Expand All @@ -89,9 +89,12 @@ Refer this [example](/index.html) for more details.

[Demo](https://rudderlabs.github.io/rudder-json-template-engine/)

### Playground
Give the JSON template engine a try in our [playground](https://transformers-workflow-engine.rudderstack.com/#/json-template) without needing to install anything.

## Features

Template is a set of statements and result the last statement is the output of the template.
The template consists of multiple statements, with the output being the result of the final statement.

### Variables

Expand Down Expand Up @@ -410,7 +413,7 @@ We can use compile time expressions to generate a template and then recompile it
If you are familiar with [JSON Paths](https://goessner.net/articles/JsonPath/index.html#), you can easily begin working with JSON templates by leveraging your existing knowledge through the mappings feature.
**Example:**
* Let's say we want to tranform the following data.
* Let's say we want to transform the following data.
* Input:
```json
{
Expand Down Expand Up @@ -451,7 +454,7 @@ If you are familiar with [JSON Paths](https://goessner.net/articles/JsonPath/ind
{
"description": "Copies properties of a to root level in the output",
"input": "$.a",
"output": "$",
"output": "$"
},
{
"description": "Combines first and last name in the output",
Expand All @@ -460,6 +463,8 @@ If you are familiar with [JSON Paths](https://goessner.net/articles/JsonPath/ind
}
]
```
* Try this example in our [playground](https://transformers-workflow-engine.rudderstack.com/#/mappings?gist=e25a6ac769ee5719e928720f5c439169).
For more examples, refer [Mappings](test/scenarios/mappings/)
### Comments
Expand Down

0 comments on commit 0a14bda

Please sign in to comment.