0.5.0 • Published 2 months ago

jsonata-functions v0.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Jsonata Functions

A small library that adds lodash, moment and uuid to jsonata

Installation

npm install jsonata-functions

yarn add jsonata-functions

Usage

To use lodash and moment functions in jsonata, you can do the following:

import jsonata from "jsonata";
import functions from "jsonata-functions";

const data = {
    text: "bla bla bla"
};

(async () => {
    let expression = jsonata('$_camelCase($.text)', {});
    expression = functions(expression);
    const result = await expression.evaluate(data);
    console.log(result);
})()

Output should be blaBlaBla

To only use lodash functions, you can do the following:

import jsonata from "jsonata";
import lodash from "jsonata-functions";

const data = {
    text: "bla bla bla"
};

(async () => {
    let expression = jsonata('$_camelCase($.text)', {});
    expression = lodash(expression, { moment: false });
    const result = await expression.evaluate(data);
    console.log(result);
})()

Tests

yarn run test

Publishing

  1. make changes...

  2. git add [changes]

  3. change version in package.json

  4. git commit -m "[message]"

  5. git tag v[version]

  6. git push origin v[version]

  7. npm publish

Goodbyes

May the love be with you!

0.5.0

2 months ago

0.4.1

2 months ago

0.4.0

4 months ago

0.3.0

4 months ago

0.3.2

4 months ago

0.3.1

4 months ago

0.2.3

4 months ago

0.2.2

4 months ago

0.2.1

4 months ago

0.2.0

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago