content-type

  • Version 2.0.0
  • Published
  • 20.8 kB
  • No dependencies
  • MIT license

Install

npm i content-type
yarn add content-type
pnpm add content-type

Overview

Create and parse HTTP Content-Type header

Index

Functions

function format

format: (obj: Partial<ContentType>) => string;
  • Format an object into a Content-Type header.

function parse

parse: (header: string, options?: ParseOptions) => ContentType;
  • Parse a Content-Type header.

Interfaces

interface ContentType

interface ContentType {}
  • The content type object contains a type string and optional parameters.

property parameters

parameters: Record<string, string>;

    property type

    type: string;

      interface ParseOptions

      interface ParseOptions {}
      • Options for parsing a Content-Type header.

      property parameters

      parameters?: boolean;

        Package Files (1)

        Dependencies (0)

        No dependencies.

        Dev Dependencies (4)

        Peer Dependencies (0)

        No peer dependencies.

        Badge

        To add a badge like this onejsDocs.io badgeto 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
          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](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>