# stir-template

> server-side template inspired by React

Latest version **0.2.2** (published 2019-12-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install stir-template
pnpm add stir-template
yarn add stir-template
bun add stir-template
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2019-12-25 |
| First published | 2014-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | jiyinyiyong |
| Maintainers | jiyinyiyong |
| Keywords | react, html, template |

## Links

- npm: https://www.npmjs.com/package/stir-template
- Repository: https://github.com/mvc-works/stir-template
- Issues: https://github.com/mvc-works/stir-template/issues
- npm.io page: https://npm.io/package/stir-template

## 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

- 0.2.2 (latest) — 2019-12-25
- 0.2.2-a1 — 2019-12-24
- 0.2.1 — 2016-11-16
- 0.2.0 — 2016-11-16
- 0.1.6 — 2016-01-06
- 0.1.5 — 2016-01-06
- 0.1.4 — 2015-04-16
- 0.1.3 — 2015-04-16
- 0.1.2 — 2015-04-06
- 0.1.1 — 2015-04-06
- 0.1.0 — 2015-04-06
- 0.0.1 — 2014-06-14

## README

Stir template
------

A string-based HTML template library inspired by React.

### Usage

```bash
npm i --save-dev stir-template
```

or

```
yarn add --dev stir-template
```

Methods:

```coffee
stir.render
stir.createElement
stir.createFactory
```

Predefined:

```coffee
stir.doctype
stir.html
stir.head
stir.body
stir.title

stir.link
stir.meta
stir.script

stir.div
stir.span
stir.a
stir.code
stir.input
stir.textarea
```

Example in CoffeeScript:

```coffee
{html, head, body, div} = stir

link = stir.createFactory 'link'
script = stir.createFactory 'script'

module.exports = (data) ->
  stir.render stir.doctype,
    html null,
      head null,
        link()
        script()
      body null,
        div name: 'a', 'empty'
        div()
```

### Difference from React

`stir-template` **does not escape DOM properties**(which React does).
Object properties are directly rendered to DOM properties.

* https://github.com/facebook/react/blob/master/src/browser/ReactDOM.js
* https://github.com/facebook/react/blob/master/src/browser/ui/dom/SVGDOMPropertyConfig.js
* https://github.com/facebook/react/blob/master/src/browser/ui/dom/HTMLDOMPropertyConfig.js


### License

MIT

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