• Version 2.0.41
  • Published
  • 6.13 kB
  • 1 dependency
  • MIT license


npm i @types/through2
yarn add @types/through2
pnpm add @types/through2


TypeScript definitions for through2



function ctor

ctor: {
(transform?: TransformFunction, flush?: FlushCallback): Through2Constructor;
opts?: stream.DuplexOptions,
transform?: TransformFunction,
flush?: FlushCallback
): Through2Constructor;
  • Creates a constructor for a custom Transform. This is useful when you want to use the same transform logic in multiple instances.

function obj

obj: (transform?: TransformFunction, flush?: FlushCallback) => stream.Transform;
  • Convenvience method for creating object streams

function through2

through2: typeof through2;


    interface Through2Constructor

    interface Through2Constructor extends stream.Transform {}

      construct signature

      new (opts?: stream.DuplexOptions): stream.Transform;

        call signature

        (opts?: stream.DuplexOptions): stream.Transform;

          Type Aliases

          type FlushCallback

          type FlushCallback = (this: stream.Transform, flushCallback: () => void) => void;

            type TransformCallback

            type TransformCallback = (err?: any, data?: any) => void;

              type TransformFunction

              type TransformFunction = (
              this: stream.Transform,
              chunk: any,
              enc: BufferEncoding,
              callback: TransformCallback
              ) => void;

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

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