resourcify

0.1.1 • Public • Published

resourcify

browserify.require() for templates and other resources, made as a set of browserify plugins.

Usually You need it to precompile client-side templates and use it in Browser.

It allows to work with resources (templates) using standard require('./my-template') as if it's an ordinary JavaScript file.

Note: You can use fileify to require all files (templates) in directory recursively.

Available plugins

  • eco - .eco
  • ejs - .ejs
  • handlebars - .hbs, .handlebars
  • hogan - .hg, .hogan
  • jade - .jade

It's also easy to add a new one. As a sample take a look at eco, it's about seven lines of code.

Installation

Install resourcify and template engine You want.

npm install resourcify jade

Plug resourcify into browserify

browserify app.js -w -p resourcify/jade -o bundle.js
...
var jade = require('resourcify/jade')
bundle.use(jade)
...

Now You can use require('/my-template') for .jade templates.

Readme

Keywords

none

Package Sidebar

Install

npm i resourcify

Weekly Downloads

0

Version

0.1.1

License

none

Last publish

Collaborators

  • alexey.petrushin