Dust.js
Asynchronous Javascript templating for the browser and server. This fork is maintained by LinkedIn.
Install
NPM
Important: We recommend that you lock your version of Dust to a specific minor version, instead of a major version. By default, NPM will add "dustjs-linkedin": "^2.x.y"
to your package.json, which will install new minor versions automatically.
npm install --save --production dustjs-linkedin
# If you want the dustc compiler available globally
npm install --global --production dustjs-linkedin
If you want to add the Dust helpers or secure filters:
npm install --save --production dustjs-helpers
npm install --save --production dustjs-filters-secure
Bower
bower install --save dustjs-linkedin
Get Started
- Read dustjs.com for guides, tutorials, and documentation.
- Check out the
examples/
directory in the repo for simple examples to help you get started using Dust in a variety of ways.
Contribute
- The team provides support on Stack Overflow, so that's the best place to ask questions.
- Bug or feature? We welcome issues and pull requests! If you'd like to submit a PR, check out the guide to contributing. PRs should include unit tests.
v2.7.2 (2015/06/08 20:41 +00:00)
- #673 Pass the current context to filters (@sethkinast)
- #676 If a Promise is resolved with an array, iterate over it instead of rendering the whole array at once.
Closes #674 (@sethkinast)
- #647 Allow helpers to return primitives
Previously returning a primitive would crash rendering with no way to recover. You can still return a Chunk and do more complex work if you need to.
Helpers act like references or sections depending on if they have a body. When they have no body, they act like a reference and look in params.filters
for filters to use. When they have a body, they act like a section. You can return thenables and streams normally.
{@return value="<Hello>" filters="|s" /}
{@return value="<Hello>"}{.} World{/return}
Closes #645 (@sethkinast)
- #664 Be slightly pickier about what Dust thinks a Stream is.
Closes #663 (@sethkinast)
- #661 Add saucelabs integration (@sethkinast)
- #658 Refactor testing frameworks
Closes #649
Closes #602
Closes #642 (@sethkinast)
- #660 Grammar: s/char/character/ to avoid using a reserved name
Closes #659 (@sethkinast)