dustjs-tmpl
v2.0.0
Published
DustJS-tmpl: the dustjs template compiler
Downloads
11
Maintainers
Readme
node-modules-dustify
DustJS-tmpl: the dustjs template compiler for NodeJS
Compile dustjs-linkedin templates into static HTML.
Installation
$ npm install dustjs-tmpl
Usage
Console
USAGE
dustjs-tmpl [options]
OPTIONS
Name Description Example
--src A dustjs file or a directory --src path/to/src
containing dustjs files. Can be
set multiple times.
--build The directory to save compiled --build path/to/build
or precompiled dustjs files.
--tplData Data passed to templates when --tplData.name Bob
compiling. Not used when --tplData.age 28
--precompile flag is set. Can
be set multiple times.
--inputExt The file extension used for the --inputExt .tmpl
source dustjs templates. Can be
set multiple times. Include the
leading period. Defaults to
'.dust' and '.tpl'.
--outputExt The file extension compiled or --outputExt .htm
precompiled templates are saved
as. Include the leading period.
Defaults to '.js' when
--precompile flag is set and
'.html' otherwise.
--version Display version. --version
--help Display this help screen. --help
Programmatically
var dustjstmpl = require("dustjs-tmpl");
dustjstmpl(OPTIONS,function(err,processed){
if (err) {
// an error has occurred
throw err;
} else {
/**
* dustjs templates successfully compiled
*
* `processed` is an object where the keys are the absolute filepaths of the
* source templates and the values are the absolute filepaths of the saved
* templates.
*/
}
});
OPTIONS
is an object which accepts the same keys as the console options described above.
Tests
$ npm test