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

Add Readme

tags/v0.1.2
Gerben 6 years ago
parent
commit
b94ae7f4eb
1 changed files with 19 additions and 0 deletions
  1. +19
    -0
      Readme.md

+ 19
- 0
Readme.md View File

@@ -0,0 +1,19 @@
# doctype-to-string

Convert a DOM [DocumentType](https://developer.mozilla.org/en-US/docs/Web/API/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](https://creativecommons.org/publicdomain/zero/1.0/); do whatever you want with this code.

Loading…
Cancel
Save