index.js
function BrotliFilter(inputNode, options) {
    if (!(this instanceof BrotliFilter))
        return new BrotliFilter(inputNode, options);

    options = options || {};

    this.brotliOptions = {
        mode: options.mode || 0,
        quality: options.quality || 11,
        lgwin: options.lgwin || 22,
        lgblock: options.lgblock || 0
    };
    this.keepUncompressed = options.keepUncompressed;
    this.appendSuffix = (options.hasOwnProperty('appendSuffix') ?
                         options.appendSuffix :
                         true);

    // Default file encoding is raw to handle binary files
    this.inputEncoding = options.inputEncoding || null;
    this.outputEncoding = options.outputEncoding || null;

    if (this.keepUncompressed && !this.appendSuffix) {
        throw new Error('Cannot keep uncompressed files without appending suffix. Filenames would be the same.');
    }

    Filter.call(this, inputNode, options);
}
function BrotliFilter(inputNode, options) {
    if (!(this instanceof BrotliFilter))
        return new BrotliFilter(inputNode, options);

    options = options || {};

    this.brotliOptions = {
        mode: options.mode || 0,
        quality: options.quality || 11,
        lgwin: options.lgwin || 22,
        lgblock: options.lgblock || 0
    };
    this.keepUncompressed = options.keepUncompressed;
    this.appendSuffix = (options.hasOwnProperty('appendSuffix') ?
                         options.appendSuffix :
                         true);

    // Default file encoding is raw to handle binary files
    this.inputEncoding = options.inputEncoding || null;
    this.outputEncoding = options.outputEncoding || null;

    if (this.keepUncompressed && !this.appendSuffix) {
        throw new Error('Cannot keep uncompressed files without appending suffix. Filenames would be the same.');
    }

    Filter.call(this, inputNode, options);
}
function BrotliFilter ( inputNode , options ) { if ( ! ( this instanceof BrotliFilter ) ) return new BrotliFilter ( inputNode , options ) ; options = options || { } ; this . brotliOptions = { mode : options . mode || 0 , quality : options . quality || 11 , lgwin : options . lgwin || 22 , lgblock : options . lgblock || 0 } ; this . keepUncompressed = options . keepUncompressed ; this . appendSuffix = ( options . hasOwnProperty ( 'appendSuffix' ) ? options . appendSuffix : true ) ; // Default file encoding is raw to handle binary files this . inputEncoding = options . inputEncoding || null ; this . outputEncoding = options . outputEncoding || null ; if ( this . keepUncompressed && ! this . appendSuffix ) { throw new Error ( 'Cannot keep uncompressed files without appending suffix. Filenames would be the same.' ) ; } Filter . call ( this , inputNode , options ) ; }
Brotli filter.

@constructor
@param {object} inputNode - Input node.
@param {object} options - Options.
Brotli filter .