content-type
- Version 3.0.0
- Published
- 23 kB
- No dependencies
- MIT license
Install
npm i content-typeyarn add content-typepnpm add content-typeOverview
Create and parse HTTP Content-Type header
Index
Functions
Interfaces
interface ContentType
interface ContentType {}The content type object contains a type string and optional parameters.
property index
index: number;property parameters
parameters: Record<string, string>;property type
type: string;interface ParseOptions
interface ParseOptions {}Options for parsing a
Content-Typeheader.
property comma
comma?: boolean;Exits early on a comma, returning the first value and parameters. This is useful for parsing
Acceptheaders.false
property parameters
parameters?: boolean;Exit early on the first semicolon, returning only the type. This is useful for parsing the MIME from
Content-Typeheaders.false
property start
start?: number;The index to start parsing from.
0
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (4)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/content-type.
- Markdown[](https://www.jsdocs.io/package/content-type)
- HTML<a href="https://www.jsdocs.io/package/content-type"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2029 ms. - Missing or incorrect documentation? Open an issue for this package.
