0.3.0 • Published 9 years ago

peachfuzz v0.3.0

Weekly downloads
1
License
CC0
Repository
github
Last release
9 years ago

peachfuzz

Travis CI Status Coveralls Status

Peach Fuzz

Simple Mustache inspired string substitution.

API

peachfuzz(template: string, context: Object, transform: Function): string

Usage

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'