doctype

Info on HTML / XHTML / MathML / SVG doctypes.
Install
npm:
npm install doctype
Use
var doctype = require('doctype')
doctype(5)
doctype(4.01)
doctype('4.01t')
doctype('4.01 Transitional')
doctype('HTML 4.01 Transitional')
doctype('svg')
API
doctype(name)
Get a doctype, where name
stripped from white-space, casing, fractional-part
of version, 'HTML'
or 'XHTML'
prefix, and suffixes are normalised
(Transitional
to t
).
Returns: string?
— When applicable.
doctype.all
{
'HTML 5': 'html',
'HTML 4.01 Strict': 'HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"',
}
Object
mapping doctype names to doctype strings. This gives raw
access to the information returned by doctype()
.
Related
License
MIT © Titus Wormer