peachfuzz
v0.3.0
Published
Simple Mustache inspired string substitution
Downloads
25
Readme
peachfuzz

Simple Mustache inspired string substitution.
API
peachfuzz(template: string, context: Object, transform: Function): stringUsage
var peachfuzz = require('peachfuzz');
peachfuzz('Hello {{name}}', { name: 'Devin' }); //=> 'Hello Devin'peachfuzz takes an optional transform argument that allows values pulled
from the context to be transformed before substitution:
var peachfuzz = require('peachfuzz');
var template = 'https://swag.shop/?product={{product}}';
var context = { product: 'Moustache Wax' };
peachfuzz(template, context, encodeURIComponent);
//=> 'https://swag.shop/?product=Moustache%20Wax'