browserify-handlebars

1.0.0 • Public • Published

browserify-handlebars

A browserify transform for handlebar templates! Yay!

Installation:

npm install browserify-handlebars

Usage:

Make a handlebars template like so:

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

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1,282
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1,282
  • 0.2.0
    4
  • 0.1.0
    2
  • 0.0.2
    1
  • 0.0.1
    3

Package Sidebar

Install

npm i browserify-handlebars

Weekly Downloads

224

Version

1.0.0

License

BSD-2-Clause

Last publish

Collaborators

  • dlmanning