# mustacheee

> {{ obj.name }}` parser in JS/TS with async support.

Latest version **1.2.1** (published 2023-09-01) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2023-09-01 |
| First published | 2023-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 28.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Viki |
| Maintainers | vikiboss |
| Keywords | mustache, template, templates, ejs |

## Links

- npm: https://www.npmjs.com/package/mustacheee
- Repository: https://github.com/vikiboss/mustacheee
- Issues: https://github.com/vikiboss/mustacheee/issues
- npm.io page: https://npm.io/package/mustacheee

## Recent versions

- 1.2.1 (latest) — 2023-09-01
- 1.2.0 — 2023-08-29
- 1.1.0 — 2023-08-24
- 1.0.1 — 2023-08-24
- 1.0.0 — 2023-08-24
- 0.0.0 — 2023-08-23

## README

# mustache**ee**

Fork from [mustache.js](https://github.com/janl/mustache.js), add async render support.

Have no test yet, **use it at your own risk**.

## Usage

```ts
import mustache from 'mustachee'

const template = 'Hello {{name}}, {{asyncValue}}, {{#asyncRender}}asyncRender{{/asyncRender}}'

const view = {
  name: 'John',
  // async value
  asyncValue: async () => {
    return Promise.resolve('async value')
  },
  asyncRender: () => {
    // custom async render function
    return (text, render) => {
      return new Promise(resolve => {
        setTimeout(async () => {
          resolve('async-' + (await render(text)) + '-async')
        }, 1000)
      })
    }
  }
}

// 1 second later: Hello John, async value, async-asyncRender-async
mustache.render(template, view).then(output => {
  console.log(output)
})

// or in async function:
// const output = await mustache.render(template, view)
```

## License

MIT

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