4.0.1 • Published 9 years ago

dust-usecontent-helper v4.0.1

Weekly downloads
132
License
Apache-2.0
Repository
-
Last release
9 years ago

dust-usecontent-helper

A dustjs helper to load content bundles into the context for use by the @message helper or the formatjs message helper.

Lead Maintainer: Aria Stewart

Build Status

Example use

var dustjs = require('dustjs-linkedin');
var helper = require('dustjs-usecontent-helper');
var messagehelper = require('dustjs-message-helper');
helper(function (context, bundleName, cb) {
    if (bundleName == 'test.properties') {
        cb(null, {hello: "world"});
    } else {
        cb(new Error("not found"));
    }
}).registerWith(dustjs);
messagehelper.registerWith(dustjs);

dustjs.render('sometemplate', {}, function (err, result) {
    console.log(err, result);
});

And a template like this

{@useContent bundle="test.properties"}
    {@message key="hello" /}
{/useContent}

should return the string "world"

4.0.1

9 years ago

4.0.0

9 years ago

4.0.0-3

9 years ago

4.0.0-2

9 years ago

4.0.0-1

9 years ago

4.0.0-0

9 years ago

3.0.0

9 years ago

2.2.1

9 years ago

2.2.0

9 years ago

2.1.2

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.1.0

10 years ago

1.0.0

10 years ago