Convert a DOM DocumentType into a string, e.g. "<!DOCTYPE html>"

Contents of doctype-to-string
Latest commit: 0.1.2 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

doctype-to-string Readme.md

doctype-to-string

Convert a DOM DocumentType (usually obtained via document.doctype) into a string, e.g.:

  • <!DOCTYPE html>
  • <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Install

npm install doctype-to-string

Usage

import doctypeToString from 'doctype-to-string'

const string = doctypeToString(document.doctype)

Licence

CC0; do whatever you want with this code.