2.0.0 • Published 2 years ago

domify v2.0.0

Weekly downloads
68,135
License
MIT
Repository
github
Last release
2 years ago

domify

Turn a HTML string into DOM elements, cross-platform

Usage

Works out of the box in the browser:

import domify from 'domify';

document.addEventListener('DOMContentLoaded', () => {
	const element = domify('<p>Hello <em>there</em></p>');
	document.body.appendChild(element);
});

You can also run it in Node.js and other non-browser environments by passing a custom implementation of document:

import {JSDOM} from 'jsdom';

const jsdom = new JSDOM();

domify('<p>Hello <em>there</em></p>', jsdom.window.document);

Note: For browser-only use, prefer DOMParser.parseFromString().

1.4.2

2 years ago

2.0.0

2 years ago

1.4.1

4 years ago

1.4.0

10 years ago

1.3.3

10 years ago

1.3.2

10 years ago

1.3.1

11 years ago

1.3.0

11 years ago

1.2.2

11 years ago

1.2.1

11 years ago

1.1.1

12 years ago

1.0.0

12 years ago

0.2.0

12 years ago

0.1.0

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago