New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

doctype

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doctype

Information for HTML doctypes

  • 2.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-44.61%
Maintainers
1
Weekly downloads
 
Created
Source

doctype

Build Coverage Downloads Size

Info on HTML / XHTML / MathML / SVG doctypes.

Install

npm:

npm install doctype

Use

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

Keywords

FAQs

Package last updated on 24 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc