# fly-nunjucks-render

> Render Nunjucks templates with Fly!

Latest version **2.1.0** (published 2017-01-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install fly-nunjucks-render
pnpm add fly-nunjucks-render
yarn add fly-nunjucks-render
bun add fly-nunjucks-render
```

## 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 | 2.1.0 |
| Published | 2017-01-31 |
| First published | 2016-02-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Luke Edwards |
| Maintainers | lukeed |
| Keywords | fly, fly-plugin, nunjucks, template, render, engine, html |

## Links

- npm: https://www.npmjs.com/package/fly-nunjucks-render
- Repository: https://github.com/lukeed/fly-nunjucks-render
- Homepage: https://github.com/lukeed/fly-nunjucks-render#readme
- Issues: https://github.com/lukeed/fly-nunjucks-render/issues
- npm.io page: https://npm.io/package/fly-nunjucks-render

## Dependencies (1)

- [nunjucks](https://npm.io/package/nunjucks.md) ^2.5.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2017-01-31
- 2.0.0 — 2016-10-22
- 1.0.0 — 2016-02-26
- 0.0.0 — 2016-02-26

## README

# fly-nunjucks-render [![][travis-badge]][travis-link]

<!-- <div align="center">
  <a href="http://github.com/flyjs/fly">
    <img width=200px  src="https://cloud.githubusercontent.com/assets/8317250/8733685/0be81080-2c40-11e5-98d2-c634f076ccd7.png">
  </a>
</div> -->

> Render [Nunjucks](https://mozilla.github.io/nunjucks/) templates with Fly.

_Issues with the output should be reported on the Nunjucks [issue tracker](https://github.com/mozilla/nunjucks/issues)._

## Install

```
npm install --save-dev fly-nunjucks-render
```

## Usage

```js
exports.views = function * (fly) {
  yield fly.source('src/*.html')
    .nunjucks({
      base: 'src/partials',
      data: {name: 'Luke Edwards'},
      // or
      dataPath: 'src/path/to/data.json'
    })
    .target('dist');
}
```

```html
<!-- src/index.html -->
<p>Hello, {{ name }}!</p>
```

## API

### .nunjucks(options)

Multiple [configuration options](https://mozilla.github.io/nunjucks/api.html#configure) for Nunjucks are available.

> **Important:** Please do not attempt to use the `watch` option. Instead, use `fly.watch()`.

See below for additional options specific to `fly-nunjucks-render`.

#### options.base

Type: `string`<br>
Default: `.`

Specify the location of your templates. Without this, Nunjucks will not be able to reliably compile or find your partials.

#### options.data

Type: `object`<br>
Default: `{}`

Context data that is passed to your templates. _Optional_

#### option.dataPath

Type: `string`<br>
Default: `''`

Similar to `options.data`, but is a path to an external file. Useful for large datasets. _Optional_

## License

MIT © [Luke Edwards](https://lukeed.com)

[travis-link]:  https://travis-ci.org/lukeed/fly-nunjucks-render
[travis-badge]: http://img.shields.io/travis/lukeed/fly-nunjucks-render.svg?style=flat-square

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