document-outerhtml
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

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 "git+https://code.treora.com/gerben/document-outerhtml#latest"

or

npm install document-outerhtml@latest

..or equivalent

Usage

import documentOuterHTML from 'document-outerhtml'

const html = documentOuterHTML(document)

Licence

CC0; do whatever you want with this code.

See also

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.43latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.43
0.1.30
0.1.20
0.1.12
0.1.01

Package Sidebar

Install

npm i document-outerhtml

Weekly Downloads

6

Version

0.1.4

License

CC0-1.0

Unpacked Size

4.22 kB

Total Files

5

Last publish

Collaborators

  • treora