# adaro

> An express renderer for DustJs Templates

Latest version **1.0.4** (published 2016-02-26) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install adaro
pnpm add adaro
yarn add adaro
bun add adaro
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2016-02-26 |
| First published | 2013-11-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Erik Toth |
| Maintainers | aredridel, grawk, jasisk, jeffharrell, totherik |
| Keywords | dustjs, express, nodejs |

## Links

- npm: https://www.npmjs.com/package/adaro
- Repository: https://github.com/krakenjs/adaro
- Homepage: http://krakenjs.com/adaro
- Issues: https://github.com/krakenjs/adaro/issues
- npm.io page: https://npm.io/package/adaro

## Dependencies (8)

- [aproba](https://npm.io/package/aproba.md) ^1.0.1
- [freshy](https://npm.io/package/freshy.md) ^1.0.0
- [verror](https://npm.io/package/verror.md) ^1.6.0
- [debuglog](https://npm.io/package/debuglog.md) ^1.0.1
- [core-util-is](https://npm.io/package/core-util-is.md) ^1.0.0
- [dustjs-helpers](https://npm.io/package/dustjs-helpers.md) ~1.7.0
- [dustjs-linkedin](https://npm.io/package/dustjs-linkedin.md) ~2.7.1
- [path-is-absolute](https://npm.io/package/path-is-absolute.md) ^1.0.0

## Recent versions

- 1.0.4 (latest) — 2016-02-26
- 1.0.0-4 (next) — 2015-05-12
- 2.0.0-4 (experimental) — 2015-04-21
- 1.0.3 — 2016-02-25
- 1.0.2 — 2016-01-29
- 1.0.1 — 2015-11-11
- 1.0.0 — 2015-07-01
- 1.0.0-15 — 2015-06-05
- 1.0.0-14 — 2015-06-05
- 1.0.0-13 — 2015-06-05
- 1.0.0-12 — 2015-06-04
- 1.0.0-11 — 2015-06-03
- 1.0.0-10 — 2015-06-02
- 1.0.0-9 — 2015-06-01
- 1.0.0-8 — 2015-06-01
- … 17 more at https://npm.io/package/adaro/versions

## README

adaro
===================

Lead Maintainer: [Aria Stewart](https://github.com/aredridel)  

[![Build Status](https://travis-ci.org/krakenjs/adaro.svg?branch=master)](https://travis-ci.org/krakenjs/adaro)

An expressjs plugin for handling DustJS view rendering. [dustjs-helpers](https://github.com/linkedin/dustjs-helpers) are
included by default in this module.

```javascript
var express = require('express');

var app = express();

var adaro = require('adaro');

var options = {
  helpers: [
    //NOTE: function has to take dust as an argument.
    //The following function defines @myHelper helper
    function (dust) { dust.helpers.myHelper = function (a, b, c, d) {} },
    '../my-custom-helpers',   //Relative path to your custom helpers works
    'dustjs-helpers',   //So do installed modules
    {
      name: '../my-custom-helpers/helper-to-render-data-with-args',
      // or use this signature if you need to pass in additional args
      arguments: { "debug": true }
    }
  ]
};

app.engine('dust', adaro.dust(options));
app.set('view engine', 'dust');

// For rendering precompiled templates:
// app.engine('js', adaro.js({ ... ));
// app.set('view engine', 'js');
```

Make sure that if you've `app.set('views', somepath)` that the path separators are correct for your operating system.


### Configuration
Config options can be used to specify dust helpers, enabled/disable caching, and custom file loading handlers.



#### `helpers` (optional) String Array, helper module names
A helper module must either:
- Conform to the API established by [dustjs-helpers] (https://github.com/linkedin/dustjs-helpers) provided by LinkedIn or 
- Export a function which accepts a single argument (being dust itself). Such files should generally be designed for use on both client and server.

Client and Server Compatible
```javascript
function setupHelpers(dust) {

   // Add helpers

}

if (typeof exports !== 'undefined') {
    module.exports = setupHelpers;
} else {
    setupHelpers(dust);
}
```

Alternate API
```javscript
module.exports = function (dust) {
    // Add helpers
};
```


#### `cache` (optional, defaults to true) Boolean
Set to true to enable dust template caching, or false to disable.


```javascript
app.engine('dust', dustjs.dust({ cache: false }));
app.set('view engine', 'dust');
```

#### `helpers` (optional) An array of helper modules to require and use.

Expects helpers to be in the form of:

```
module.exports = function (dust, [options]) {
    dust.helpers.something = function (chunk, context, bodies, params) {
    };
};
```

## Breaking changes

#### `v1.0.0`

* Removed the `layout:` option to render and in configuration
* Dust is our own private instance, not global. If you load helpers, you must do it in the configuration of adaro.
* We outright require dust. We will not use your application's installed version.
* Dust ~2.7.1 is required. Dust minors are breaking changes, so those affect users of this module too.
* Paths passed to the engine that are filesystem absolute paths will be used as is, and not resolved against the view root.
* `dustjs-helpers` is not loaded for you automatically. Add it to your helpers configuration if you want it. Make sure you use a version compatible with the dustjs-linkedin that adaro uses.

---
_Source: https://npm.io/package/adaro · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
