0.2.0 • Published 7 years ago

browserify-dustjs v0.2.0

Weekly downloads
647
License
BSD-2-Clause
Repository
github
Last release
7 years ago

browserify-dustjs NPM Module NPM Module

browserify transform for dust template files

Install

npm install browserify-dustjs --save-dev

Use

var template = require("../views/template.dust");

template({title:"Browserify is Awesome!", mood:"happy"}, function(err, html) {
    // Deal with html
});

template(function(err, html) {
    // Also works without context
});

Transform

To use it from the command line:

browserify -t browserify-dustjs file.js

To use it from node:

var browserify = require('browserify');
var dustify = require('browserify-dustjs');

var b = browserify();
b.add('view.js');
b.transform(dustify);

b.bundle().pipe(process.stdout);

Note that by default browserify-dustjs transforms only .dust and .html files. You can add more extensions:

...
// transform `.dust`, `.html`, and `.tpl` files
b.transform(dustify.configure('.tpl'));
...

or specify all extensions:

...
// transform only `.dust` and `.tpl` files
b.transform(dustify.configure(['.dust', '.tpl']));
...

or both:

...
// transform only `.dust`, `.tpl`, and `.xyz` files
b.transform(dustify.configure(['.dust', '.tpl']).configure('.xyz'));
...
0.2.0

7 years ago

0.2.0-beta.2

8 years ago

0.2.0-beta.1

8 years ago

0.2.0-beta.0

8 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago