node package manager


compile vash templates for use with browserify


Use Vash with Browserify and get your templates compiled during the transform

npm install vashify
var template = require('./your-template.vash');
var $ = require('jquery');
$('body').append(template({ name: 'Mike', traits: ['bro', 'tall']}));
    <li>You are @t</t>
browserify -t vashify your-file.js > bundle.js
var vash = require('vash-runtime');
var tmpl = require('./your-template.vash');
vash.helpers.fullName = function(model){
  return model.first + ' ' + model.last;
tmpl({first:'Barbra', last: 'Streisand';});
@html.fullName(model)... @html.fullName(model).

Module references like require('*.vash') files will be intercepted during the browserify transform. Once intercepted, the template is compiled and a new module that exports the complied template function is generated.

The vash runtime is automatically included one time, the first time a vash file is required.

This means templates that are required multiple times will only appear in the bundle once and the vash runtime is only included once... which is good for business.