# jsx-dom-factory

> Factory for JSX-transpiled elements that uses document.createElement

Latest version **1.2.0** (published 2022-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsx-dom-factory
pnpm add jsx-dom-factory
yarn add jsx-dom-factory
bun add jsx-dom-factory
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-05-01 |
| First published | 2015-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sam Dunster |
| Maintainers | sdunster |

## Links

- npm: https://www.npmjs.com/package/jsx-dom-factory
- Repository: https://github.com/sdunster/jsx-dom-factory
- Homepage: https://github.com/sdunster/jsx-dom-factory#readme
- Issues: https://github.com/sdunster/jsx-dom-factory/issues
- npm.io page: https://npm.io/package/jsx-dom-factory

## Dependencies (1)

- [underscore](https://npm.io/package/underscore.md) ^1.8.3

## Recent versions

- 1.2.0 (latest) — 2022-05-01
- 1.1.0 — 2015-12-22
- 1.0.1 — 2015-12-20
- 1.0.0 — 2015-12-16

## README

# jsx-dom-factory
Factory that uses `document.createElement()` for JSX-transpiled elements.

# Usage
Install [jsx-transform](https://www.npmjs.com/package/jsx-transform):
`npm install --save jsx-transform`

Configure it according to the documentation and choose a factory name like
"DOM".

Then at the top of each file containing JSX import this module:

```
var DOM = require('jsx-dom-factory');
```

You can then factory HTML elements super-easily:

```
var name = "Sam";
var element = <div>Hello {name}!</div>;
container.appendChild(element);
```
```
var element = (
  <ul>
    <li style="font-weight:bold">Test 1</li>
    <li>Test 2</li>
  </ul>
);
$('#container').append(element);
```

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