JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2136
  • Score
    100M100P100Q114499F
  • License MIT

Information for HTML doctypes

Package Exports

  • doctype

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (doctype) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

doctype

Build Coverage Downloads Size

Info on HTML / XHTML / MathML / SVG doctypes.

Installation

npm:

npm install doctype

Usage

var doctype = require('doctype')

doctype(5)
// => 'html'

doctype(4.01)
doctype('4.01t')
doctype('4.01 Transitional')
doctype('HTML 4.01 Transitional')
// => 'HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"'

doctype('svg')
// => 'svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"'

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().

License

MIT © Titus Wormer