peachfuzz

0.3.0 • Public • Published

peachfuzz

Travis CI Status Coveralls Status

Peach Fuzz

Simple Mustache inspired string substitution.

API

peachfuzz(templatestring, contextObject, transformFunction)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'

Package Sidebar

Install

npm i peachfuzz

Weekly Downloads

0

Version

0.3.0

License

CC0

Last publish

Collaborators

  • devinus