https://github.com/dadi/dustjs-helpers
https://github.com/dadi/dustjs-helpers
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/dadi/dustjs-helpers
- Owner: dadi
- Created: 2016-04-15T23:16:40.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-10-09T01:47:03.000Z (over 6 years ago)
- Last Synced: 2024-04-25T20:04:25.114Z (about 2 years ago)
- Language: JavaScript
- Size: 62.5 KB
- Stars: 2
- Watchers: 6
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DADI Dust.js helpers
[](https://www.npmjs.com/package/@dadi/dustjs-helpers)
[](https://github.com/dadi/dustjs-helpers)
[](https://travis-ci.org/dadi/dustjs-helpers)
[](http://standardjs.com/)
[](https://github.com/semantic-release/semantic-release)
> A collection of Dust.js helpers used in DADI+ projects.
## Install
```
npm install @dadi/dustjs-helpers --save
```
## Load the helpers
```js
/* app/utils/helpers/loader.js */
// first, a reference to the loaded pages and routes within your application
var components = require('@dadi/web').Components
// also, a reference to the Dust template module inside DADI Web
var dust = require('@dadi/web').Dust
// Load DADI helpers
require('@dadi/dustjs-helpers')(dust.getEngine(), { components: components })
```
## More helpers
We also recommend including the common DustJS helpers from https://github.com/rodw/common-dustjs-helpers.
```
npm install common-dustjs-helpers --save
```
Add the following to your `loader.js` file
```js
// Load common-dustjs-helpers
var commonDustHelpers = require('common-dustjs-helpers')
new commonDustHelpers.CommonDustjsHelpers().export_helpers_to(dust.getEngine())
```
## Development
1. Clone this repository
2. Make your changes to `dadi-dustjs-helpers.js`
3. Add your tests to `test/test.js`
4. Run test suite
```
npm test
```
5. Build minified file
```
npm run build
```