gulp-transform

  • Version 3.0.5
  • Published
  • 4 dependencies
  • MIT license

Install

npm i gulp-transform
yarn add gulp-transform
pnpm add gulp-transform

Overview

A Gulp plugin for applying custom transformations to the contents of files

Index

Functions

Type Aliases

Functions

function gulpTransform

gulpTransform: {
(
encoding: gulpTransform.Encoding,
callback: (contents: string, file: File) => string | PromiseLike<string>
): NodeJS.ReadWriteStream;
(
encoding: null,
callback: (contents: Buffer, file: File) => any
): NodeJS.ReadWriteStream;
(
options: { encoding: gulpTransform.Encoding; thisArg?: any },
callback: (contents: string, file: File) => string | PromiseLike<string>
): NodeJS.ReadWriteStream;
(
options: { encoding?: null; thisArg?: any },
callback: (contents: Buffer, file: File) => any
): NodeJS.ReadWriteStream;
(callback: (contents: Buffer, file: File) => any): NodeJS.ReadWriteStream;
};
  • Creates a Gulp plugin stream that performs a user-defined transformation on file contents.

    Parameter encoding

    A character encoding used to convert the file contents to a string, or null to invoke the callback with a Buffer. Defaults to null.

    Parameter callback

    A callback describing the transformation. Invoked with (0) the file contents and (1) the File object. Returns either the new contents or a Promise for the new contents. Returns a Gulp plugin stream.

  • Creates a Gulp plugin stream that performs a user-defined transformation on file contents.

    Parameter options

    An object that accepts the following options: - encoding: A character encoding used to convert the file contents to a string, or null to invoke the callback with a Buffer. Defaults to null. - thisArg: The value of this within the callback. Defaults to undefined.

    Parameter callback

    A callback describing the transformation. Invoked with (0) the file contents and (1) the File object. Returns either the new contents or a Promise for the new contents. Returns a Gulp plugin stream.

  • Creates a Gulp plugin stream that performs a user-defined transformation on file contents.

    Parameter callback

    A callback describing the transformation. Invoked with (0) the file contents and (1) the File object. Returns either the new contents or a Promise for the new contents. Returns a Gulp plugin stream.

Type Aliases

type Encoding

type Encoding =
| 'ascii'
| 'utf8'
| 'utf16le'
| 'ucs2'
| 'base64'
| 'latin1'
| 'binary'
| 'hex';
  • A character encoding supported by Node.js.

Package Files (1)

Dependencies (4)

Dev Dependencies (18)

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/gulp-transform.

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