botl

1.0.0 • Public • Published

bOTL.js

bOTL Object Transformation Language v3 It's Mustache for JSON

This is a JavaScript implementation of bOTL v3.

Get started by reading the bOTL specification at Medium.

Usage

Node.js

const botl = require("botl");
 
let source = {"name": "Freddo"};
let transform = "#$.name";
 
let result = botl.transform(source, transform);
// result: "Freddo" 

Web

Just grab the file bOTL.js and use it like this:

<script type="text/javascript" src="bOTL.js"></script>
 
<script>
  let source = {"name": "Freddo"};
  let transform = "#$.name";
 
  let result = bOTL.transform(source, transform);
  // result: "Freddo"
</script>

Using Github as a CDN

Don't want to download anything at all? Try this fiddle. Note that this uses a Github Pages url (https://emlynoregan.github.io/bOTL_js/bOTL.js), which has usage limits.

Miscelaneous

You can also use a package manager like yarn, npm or bower (deprecated).

Acknowledgements

bOTL.js includes Stefan Goessner's JSONPath implementation, released under an MIT license.

Package Sidebar

Install

npm i botl

Weekly Downloads

1

Version

1.0.0

License

Apache License 2.0

Last publish

Collaborators

  • vaishnavi21
  • ivan.stanishev
  • trdelnik_squad
  • igrom