Contents of document-outerhtml
Latest commit: Published by publish-to-git 3 months ago

lib 3 months ago 3 months ago
package.json 3 months ago


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.


npm install "git+"

npm install document-outerhtml@latest

..or equivalent


import documentOuterHTML from 'document-outerhtml'

const html = documentOuterHTML(document)


CC0; do whatever you want with this code.

See also