# async-nunjucks

> use nunjucks with ES6 Promise

Latest version **0.0.1-beta.20** (published 2023-08-27) · 0 weekly downloads

## Install

```sh
npm install async-nunjucks
pnpm add async-nunjucks
yarn add async-nunjucks
bun add async-nunjucks
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1-beta.20 |
| Published | 2023-08-27 |
| First published | 2023-06-26 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Baolong Wang |
| Maintainers | wangbaolong36 |
| Keywords | async, nunjucks |

## Links

- npm: https://www.npmjs.com/package/async-nunjucks
- Repository: https://github.com/Max10240/create-ts-app-monorepo
- Homepage: https://github.com/Max10240/create-ts-app-monorepo#readme
- Issues: https://github.com/Max10240/create-ts-app-monorepo/issues
- npm.io page: https://npm.io/package/async-nunjucks

## Dependencies (2)

- [nunjucks](https://npm.io/package/nunjucks.md) ^3.2.4
- [nunjucks-async-loader](https://npm.io/package/nunjucks-async-loader.md) ^2.1.1

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.0.1-beta.20 (latest) — 2023-08-27
- 0.0.1-beta.19 — 2023-08-27
- 0.0.1-beta.18 — 2023-07-09
- 0.0.1-beta.17 — 2023-07-09
- 0.0.1-beta.16 — 2023-07-09
- 0.0.1-beta.15 — 2023-07-09
- 0.0.1-beta.14 — 2023-07-09
- 0.0.1-beta.13 — 2023-07-09
- 0.0.1-beta.12 — 2023-06-26
- 0.0.1-beta.11 — 2023-06-26
- 0.0.1-beta.10 — 2023-06-26
- 0.0.1-beta.9 — 2023-06-26
- 0.0.1-beta.4 — 2023-06-26
- 0.0.1-beta.2 — 2023-06-26
- 0.0.1-beta.1 — 2023-06-26

## README

# async-nunjucks

## Introduction
use nunjucks with ES6 Promise!

## Installation and Usage
```shell
npm install async-nunjucks
```

### Rendering template asynchronously
```typescript
import { AsyncNunjucks } from 'async-nunjucks';

const TEMPLATE_DIR = 'templates/';
const TEMPLATE_FILENAME = 'demo.njk';

const engine = new AsyncNunjucks({
  loader: [TEMPLATE_DIR],
  configure: {
    autoescape: false,
  },
});

async function welcome() {
  // rendering asynchronously
  const result = await engine.renderPromise(TEMPLATE_FILENAME, {
    name: 'Max10240',
  });

  console.log('2. render result:', result);
}


// Go!
welcome();

Promise.resolve().then(() =>
  console.log(`1. i am faster than "renderPromise", it won't block me!`)
);

```
A live example can bee seen at: [stackblitz example](https://stackblitz.com/edit/node-7z9srx)

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