Skip to content

Use @gfx/zopfli with Nodejs streams. #21

@gios

Description

@gios

I am wondering if possible to use this library as a stream like node-zopfli. I've found only callback and async methods, it would be great to add methods which implements stream interface.

node-zopfli

const zopfli = require('node-zopfli');
fs.createReadStream('file.js')
  .pipe(zopfli.createGzip(options))
  .pipe(fs.createWriteStream('file.js.gz'));

@gfx/zopfli (hypothetical)

const zopfli = require('@gfx/zopfli'); // or const { createGzip } = require('@gfx/zopfli');
fs.createReadStream('file.js')
  .pipe(zopfli.createGzip(options)) // or  .pipe(createGzip(options))
  .pipe(fs.createWriteStream('file.js.gz'));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions