# dustjs-loader

> Require and automatically compile dustjs (.dust) files.

Latest version **1.1.0** (published 2015-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install dustjs-loader
pnpm add dustjs-loader
yarn add dustjs-loader
bun add dustjs-loader
```

## 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.1.0 |
| Published | 2015-06-24 |
| First published | 2015-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Scott Brady |
| Maintainers | scottbrady |
| Keywords | dust, dustjs, template, load, compile, extension |

## Links

- npm: https://www.npmjs.com/package/dustjs-loader
- Repository: https://github.com/scottbrady/dustjs-loader
- Issues: https://github.com/scottbrady/dustjs-loader/issues
- npm.io page: https://npm.io/package/dustjs-loader

## Dependencies (2)

- [bluebird](https://npm.io/package/bluebird.md) ~2.9.30
- [dustjs-linkedin](https://npm.io/package/dustjs-linkedin.md) ~2.7.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-06-24
- 1.0.0 — 2015-02-09

## README

[![NPM version](https://badge.fury.io/js/dustjs-loader.svg)](http://badge.fury.io/js/dustjs-loader)

# dustjs-loader

Module to automatically compile and cache [dustjs (.dust) files](https://github.com/linkedin/dustjs).

## Installation

This package is available on npm as:

```
npm install dustjs-loader
```

## Examples

Example using a callback:

```
require('dustjs-loader').register({
  path: 'lib/templates'
});

var template = require('./template.dust');

template({ foo : 42 }, function (error, html) {
  if (error) { ... }
  ...
});
```

Example using a promise:

```
require('dustjs-loader').register({
   path    : 'lib/templates',
   promise : true
});

var template = require('./template.dust');

template({ foo : 42 })
  .then(function (html) {
    ...
  })
  .catch(function (error) {
    ...
  });
```

## Dust templates in the browser

The [dustjs-browserify module](https://github.com/scottbrady/dustjs-browserify) makes it easy to use dust templates in the browser.

## Dustjs documentation

* [Dust Tutorial](https://github.com/linkedin/dustjs/wiki/Dust-Tutorial)
* [Dust little less know language constructs](https://github.com/linkedin/dustjs/wiki/Dust-little-less-know-language-constructs)
* [Demo of using template engines with express.js and node.js](https://github.com/chovy/express-template-demo)
* [Original Dustjs project by akdubya](http://akdubya.github.io/dustjs/)

## Security

* [Add additional security filters to Dustjs](https://github.com/linkedin/dustjs-filters-secure)

## License

MIT

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