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

Readme.md 687 B

12345678910111213141516171819202122232425
  1. # doctype-to-string
  2. Convert a DOM [DocumentType](https://developer.mozilla.org/en-US/docs/Web/API/DocumentType) (usually obtained via `document.doctype`) into a string, e.g.:
  3. - `<!DOCTYPE html>`
  4. - `<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">`
  5. ## Install
  6. npm install "git+https://code.treora.com/gerben/doctype-to-string#latest"
  7. ..or
  8. npm install doctype-to-string@latest
  9. ..or equivalent
  10. ## Usage
  11. import doctypeToString from 'doctype-to-string'
  12. const string = doctypeToString(document.doctype)
  13. ## Licence
  14. [CC0](https://creativecommons.org/publicdomain/zero/1.0/); do whatever you want with this code.