This package has been deprecated

Author message:

Please use the gulp-brotli package instead, the package has been moved and released as gulp-brotli@2 thanks to the generous donation by ~mayham.

@seznam/gulp-brotli
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

gulp-brotli

Build Status npm License npm type definitions

A gulp plugin for file compression using the brotli compression included in node.js's zlib native module, without any native or WASM extraneous libraries.

Installation

gulp-brotli is available as npm package, you can use npm to install it:

npm install --save-dev @seznam/gulp-brotli

Usage

Since @seznam/gulp-brotli uses the native brotli support in node.js, all the native API's options are directly exposed to keep things simple and flexible. The only extra option is the optional extension which specifies the file name extension to add the file names of all compressed files (without the leading dot (.)). The extension option defaults to br.

import gulpBrotli from '@seznam/gulp-brotli'
import gulp from 'gulp'
import zlib from "zlib";

export function compressBrotli() {
  return gulp
    .src(`path/to/files/to/compress`)
    .pipe(gulpBrotli({
      // the options are document at https://nodejs.org/docs/latest-v10.x/api/zlib.html#zlib_class_brotlioptions 
      params: {
        // brotli parameters are document at https://nodejs.org/docs/latest-v10.x/api/zlib.html#zlib_brotli_constants
        [zlib.constants.BROTLI_PARAM_QUALITY]: zlib.constants.BROTLI_MAX_QUALITY,
      },
    }))
    .pipe(gulp.dest(`destination/path/which/is/usually/the/source/path`));
}

Note that @seznam/gulp-brotli support only compressing the files.

Readme

Keywords

Package Sidebar

Install

npm i @seznam/gulp-brotli

Weekly Downloads

0

Version

1.0.1

License

ISC

Unpacked Size

7.3 kB

Total Files

6

Last publish

Collaborators

  • jurca
  • mjancarik