# json2dom

> A utility for generating DOM string from JSON

Latest version **1.0.7** (published 2015-09-28) · MIT license · 0 weekly downloads

## Install

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

## 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.0.7 |
| Published | 2015-09-28 |
| First published | 2015-09-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Balan |
| Maintainers | balan |
| Keywords | json2dom, domutility, json, to, dom |

## Links

- npm: https://www.npmjs.com/package/json2dom
- npm.io page: https://npm.io/package/json2dom

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.7 (latest) — 2015-09-28
- 1.0.6 — 2015-09-28
- 1.0.5 — 2015-09-28
- 1.0.4 — 2015-09-28
- 1.0.3 — 2015-09-26
- 1.0.1 — 2015-09-26

## README

A very simple utility for generating HTML from a JSON. Useful while working with isomorphic apps where you need to share markup between client and server.

```js

var json2dom = require("json2dom");

var json = { 
	tagname:"div",
	attributes:{
		id:"hello",
		class:"world"},
	value:"hello, World",
	children:[
		{
			tagname:"img",
			attributes:{
				src:"hello.png"
			}
		},
		{
			tagname:"p",
			value:"content of child"
		}
	]
	};

var html = json2dom(json);

```


would create an HTML string like

```html

<div id='hello' class='world'>
	<img src='hello.png'></img>
	<p>content of child</p>
hello, World
</div>

```

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