# whatwg-flora-tmpl

> Streaming templates for node and Web using WhatWG streams. Based on flora-stream

Latest version **1.0.3** (published 2020-07-06) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install whatwg-flora-tmpl
pnpm add whatwg-flora-tmpl
yarn add whatwg-flora-tmpl
bun add whatwg-flora-tmpl
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-07-06 |
| First published | 2020-06-12 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 48 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Paul Kinlan |
| Maintainers | kinlan |
| Keywords | templates |

## Links

- npm: https://www.npmjs.com/package/whatwg-flora-tmpl
- npm.io page: https://npm.io/package/whatwg-flora-tmpl

## Dependencies (1)

- [web-streams-polyfill](https://npm.io/package/web-streams-polyfill.md) ^2.1.1

## Recent versions

- 1.0.3 (latest) — 2020-07-06
- 1.0.2 — 2020-07-06
- 1.0.1 — 2020-06-12
- 1.0.0 — 2020-06-12

## README

# flora

> __whatwg-flora-tmpl__ on npm.

Streaming templates using WhatWG Streams based on the [Flora](https://www.npmjs.com/package/flora-tmpl) Node Streams templating engine.

# Why

HTML is a format that can be streamed. Meaning the browser can start parsing and showing parts of a web page before the full thing has been downloaded. Your application probably has things it needs to do that take some time; like make database requests.

Parts of your page depend on this data, but much of it does not. Whatwg-Flora allows you to write templates that get to the client as quickly as possible, because only the parts that need to wait, do wait.

This can be used in Node, in a Service Worker or even just the browser.

## Install

```shell
yarn add whatwg-flora-tmpl
```

## Usage

```js
import template from 'whatwg-flora-tmpl';

const items = [1,2,3,4];

template`
    <h1>${items.length} doubles</h1>
    <ul>
      ${items.map(i => template`<li>${i * 2}</li>`)};
    </ul>
  `;
```

## License

BSD 2 Clause

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