2.0.0 • Published 5 months ago

domify v2.0.0

Weekly downloads
68,135
License
MIT
Repository
github
Last release
5 months 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

5 months ago

2.0.0

5 months ago

1.4.1

3 years ago

1.4.0

9 years ago

1.3.3

9 years ago

1.3.2

9 years ago

1.3.1

10 years ago

1.3.0

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.1.1

10 years ago

1.0.0

11 years ago

0.2.0

11 years ago

0.1.0

12 years ago

0.0.3

12 years ago

0.0.2

12 years ago