Proyectos
Ver en GitHub
sindresorhus/domify
Acerca de
html -> elements
Desarrollo web y de aplicacionesCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
Originaldomify
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().
Explorar proyectos relacionados
Cargando…