Jens Hjalmarsson
var format = require('formata');
var indexes = 'The quick {1} {2} jumps over the lazy {3}.';
var keywords = 'The quick {color} {animal} jumps over the lazy {lazyanimal}.';
indexes.format(1, 'dog', 'fox');
// or
format(indexes, 1, 'dog', 'fox');
// output:
// The quick 1 dog jumps over the lazy fox.
indexes.format([1, 'fox', 'cat']);
// or
format(indexes, [1, 'fox', 'cat']);
// output:
// The quick 1 fox jumps over the lazy cat.
keywords.format({color: 'blue', animal: 'rabbit', lazyanimal: 'fox'});
// or
format(keywords, {color: 'blue', animal: 'rabbit', lazyanimal: 'fox'});
// output:
// The quick blue rabbit jumps over the lazy fox.
indexes.format('blue', 'rabbit');
// or
keywords.format({color: 'blue', animal: 'rabbit'});
// output:
// The quick blue fox jumps over the lazy {3}.
// The quick blue fox jumps over the lazy {lazyanimal}.
indexes.format('colored', {}, ['values', 'inside', 'array']);
// output:
// The quick colored [object Object] jumps over the lazy values,inside,array.