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 = ; let source = "name": "Freddo";let transform = "#$.name"; let result = botl;// 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; // 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.