browserify transform for handlebars template files

npm install browserify-handlebars
4 downloads in the last day
34 downloads in the last week
117 downloads in the last month


A browserify transform for handlebar templates! Yay!


npm install browserify-handlebars


Make a handlebars template like so:

<!DOCTYPE html>
  <title>{{ title }}</title>
<p>Hello there, {{name}}</p>

Now require() the handlebar template file in code like so:

var aTemplateFunction = require('./template.handlebars');

var html = aTemplateFunction({title: "An instantiated template!", name: "David"});

and run browserify with the transform option:

browserify -t browserify-handlebars entry-point.js

That's all!

Implementation details

This transform module packages the handlebars templates with the handlebars runtime, which is smaller than the complete handlebars library. This is good, because it means smaller bundle files for you.

npm loves you