Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 587 Bytes

README.md

File metadata and controls

26 lines (19 loc) · 587 Bytes

jazzon-format

Format strings using util.format

Usage

Here is an example where we're using it together with jazzon-faker to wrap a lipsum text in p tags.

const jazzon = require('jazzon');
const faker = require('jazzon-faker');
const format = require('jazzon-format');
const json = { title: '@{ lorem.sentences(3) | format(<p>%s</p>) }' };

jazzon
  .use(faker())
  .use(format())
  .compile(json)
  .then((result) => {
    console.log(result); // => { "title": "<p>Lorem ipsum dolor sit…</p>" }
  });

Licence

MIT