Contents of document-outerhtml
Latest commit: 0.1.1 11 months ago

src 1 year ago
test 1 year ago
.gitignore 1 year ago
Readme.md 1 year ago
package-lock.json 11 months ago
package.json 11 months ago

document-outerhtml Readme.md

document-outerhtml

Like Element.outerHTML, but for the whole Document.

This means it returns a string containing the <html>.....</html> with all the content between, plus the <!DOCTYPE ....> declaration (if present), and any comments and stray elements or text nodes.

Install

npm install document-outerhtml

Usage

import documentOuterHTML from 'document-outerhtml'

const html = documentOuterHTML(document)

Licence

CC0; do whatever you want with this code.

See also