lib/gzip.js
async function gzip(input, dst, level=4){
    // is input a filename or stream ?
    if (typeof input === 'string'){
        input = await _fileInputStream(input);
    }

    // compress
    const gzipStream = input.pipe(_zlib.createGzip({
        level: level
    }));

    // write content to file
    return _fileOutputStream(gzipStream, dst);
}
async function gzip(input, dst, level=4){
    // is input a filename or stream ?
    if (typeof input === 'string'){
        input = await _fileInputStream(input);
    }

    // compress
    const gzipStream = input.pipe(_zlib.createGzip({
        level: level
    }));

    // write content to file
    return _fileOutputStream(gzipStream, dst);
}
async function gzip ( input , dst , level = 4 ) { // is input a filename or stream ? if ( typeof input === 'string' ) { input = await _fileInputStream ( input ) ; } // compress const gzipStream = input . pipe ( _zlib . createGzip ( { level : level } ) ) ; // write content to file return _fileOutputStream ( gzipStream , dst ) ; }
compress a file
compress a file