vary

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

Install

npm i vary
yarn add vary
pnpm add vary

Overview

Manipulate the HTTP Vary header

Index

Functions

function append

append: (header: string, field: string | readonly string[]) => string;
  • Append one or more fields to a Vary header.

function format

format: (fields: readonly string[]) => string;
  • Format field names as a Vary header.

function parse

parse: (header: string) => string[];
  • Parse the non-empty members of a Vary header.

function vary

vary: (res: Response, field: string | readonly string[]) => void;
  • Add one or more fields to a response's Vary header.

Interfaces

interface Response

interface Response {}
  • A response with methods for reading and setting headers.

method getHeader

getHeader: (name: string) => string | number | readonly string[] | undefined;

    method setHeader

    setHeader: (name: string, value: string) => unknown;

      Package Files (1)

      Dependencies (0)

      No dependencies.

      Dev Dependencies (7)

      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/vary.

      • Markdown
        [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/vary)
      • HTML
        <a href="https://www.jsdocs.io/package/vary"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>