# sfn-nunjucks-engine

> Nunjucks template engine for sfn framework.

Latest version **0.1.1** (published 2018-02-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install sfn-nunjucks-engine
pnpm add sfn-nunjucks-engine
yarn add sfn-nunjucks-engine
bun add sfn-nunjucks-engine
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2018-02-08 |
| First published | 2018-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ayon Lee |
| Maintainers | hyurl |
| Keywords | sfn, nunjucks |

## Links

- npm: https://www.npmjs.com/package/sfn-nunjucks-engine
- Repository: https://github.com/hyurl/sfn-nunjucks-engine
- Homepage: https://github.com/hyurl/sfn-nunjucks-engine#readme
- Issues: https://github.com/hyurl/sfn-nunjucks-engine/issues
- npm.io page: https://npm.io/package/sfn-nunjucks-engine

## Dependencies (2)

- [nunjucks](https://npm.io/package/nunjucks.md) ^3.0.1
- [@types/nunjucks](https://npm.io/package/@types/nunjucks.md) ^3.0.0

## Recent versions

- 0.1.1 (latest) — 2018-02-08

## README

# Sfn-Nunjucks-Engine

**Nunjucks template engine for [sfn](https://github.com/hyurl/sfn) framework.**

For more informatioin about nunjucks, please visit 
[https://mozilla.github.io/nunjucks/](https://mozilla.github.io/nunjucks/).

## Install

```sh
npm i sfn-nunjucks-engine
```

## Example

```typescript
import { HttpController, route } from "sfn";
import { NunjucksEngine } from "sfn-nunjucks-engine";

var engine = new NunjucksEngine();

export default class extends HttpController {
    engine: NunjucksEngine = engine;

    @route.get("/nunjucks-test")
    index() {
        return this.view("nunjucks-test.nunjucks");
    }
}
```

## API

### `new NunjucksEngine(options?: NunjucksOptions)`

Interface `NunjucksOptions` includes:

- `autoescape: boolean` (default: `true`) controls if output with dangerous 
    characters are escaped automatically.
- `throwOnUndefined: boolean` (default: `false`) throw errors when outputting 
    a null/undefined value.
- `trimBlocks: boolean` (default: `false`) automatically remove trailing 
    newlines from a block/tag.
- `lstripBlocks: boolean` (default: `false`) automatically remove leading 
    whitespace from a block/tag.
- `watch: boolean` (default: `false`) reload templates when they are changed 
    (server-side). To use watch, make sure optional dependency `chokidar` is 
    installed.
- `tags: object` defines the syntax for nunjucks tags.

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