Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Clarke danclarke

View GitHub Profile
@danclarke
danclarke / compress.js
Created Mar 20, 2017
Compress files in directory and sub directories using gzip and brotli
View compress.js
const brotli = require('brotli');
const zlib = require('zlib');
const fs = require('fs');
const path = require('path');
const compressDir = function (dir) {
console.log('Reading in: ' + dir);
fs.readdir(dir, function (err, files) {
if (err) {
console.error("Could not list the directory.", err);
You can’t perform that action at this time.