Skip to content

scottbrady/dustjs-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPM version

dustjs-loader

Module to automatically compile and cache dustjs (.dust) files.

Installation

This package is available on npm as:

npm install dustjs-loader

Examples

Example using a callback:

require('dustjs-loader').register({
  path: 'lib/templates'
});

var template = require('./template.dust');

template({ foo : 42 }, function (error, html) {
  if (error) { ... }
  ...
});

Example using a promise:

require('dustjs-loader').register({
   path    : 'lib/templates',
   promise : true
});

var template = require('./template.dust');

template({ foo : 42 })
  .then(function (html) {
    ...
  })
  .catch(function (error) {
    ...
  });

Dust templates in the browser

The dustjs-browserify module makes it easy to use dust templates in the browser.

Dustjs documentation

Security

License

MIT

About

Require and automatically compile dustjs (.dust) files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published