• Version 1.0.3
  • Published
  • 4.28 kB
  • 1 dependency
  • MIT license


npm i @types/on-headers
yarn add @types/on-headers
pnpm add @types/on-headers


TypeScript definitions for on-headers




function onHeaders

onHeaders: (
res: ServerResponse,
listener: (this: ServerResponse) => void
) => void;
  • This will add the listener to fire when headers are emitted for res. The listener is passed the response object as its context (this). Headers are considered emitted only once, right before they are sent to the client.

    When this is called multiple times on the same res, the listeners are fired in the reverse order they were added.

    Parameter res

    HTTP server response object

    Parameter listener

    Function to call prior to headers being emitted, the response object is passed as this context.

Package Files (1)

Dependencies (1)

Dev Dependencies (0)

No dev dependencies.

Peer Dependencies (0)

No peer dependencies.


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/@types/on-headers.

  • Markdown
  • HTML
    <a href="https://www.jsdocs.io/package/@types/on-headers"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>