Skip to content

PrateekJha07/json-e

 
 

Repository files navigation

JSON-e

JSON-e is a data-structure parameterization system written for embedding context in a JSON objects.

The central idea is to treat a data structure as a "template" and transform it, using another data structure as context, to produce an output data structure.

There are countless libraries to do this with strings, such as mustache. What makes JSON-e unique is that it operates on data structures, not on their textual representation. This allows input to be written in a number of formats (JSON, YAML, etc.) or even generated dynamically.

Interface

The JS module exposes following interface:

import jsone from 'json-e';

var template = {a: "{{ foo.bar }}"};
var context = {foo: {bar: "zoo"}};
console.log(jsone(template, context));
// -> { a: 'zoo' }

Language

TODO: document language features (use github-pages?)

See specification.yml for now.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%