Closed KyivJunta closed 10 years ago
If needed also can update README with some some examples and new features.
Great work! I will merge when I get a chance.
Actually just pointed out that it needs some fixes with tests and utils module. I'l note you when its ready. BTW thanks for fast response!
All done, ready for merging. BTW, when using main gulpfile.js
for livecoding with testing, there is some bug with gulp-watch
dependency - gaze
, so test
task can be runned multiple times.
Its now ready to merge pr and update npm package.
I will merge this when I get a change. You essentially rewrote the entire plugin though, so I want to review it thoroughly rather than doing an auto-merge.
Ok. I created temporary repo/npm gzip2. When (if) you will be ready, notify me and ill delete them.
Alright, I merged these changes, but I reorganized a little bit. I like to keep the main module code in index.js if it isn't too complicated. I also pulled out the threshold checking for stream mode and put it in util.js.
I really like your testing code. Good work. Thanks for the PR!
HI, just wanted to have control of what should be compressed depending on size and wanted to have an option to NOT append .gz extension (usually CDN can respond with correct headers independently of extension).
Result - 2 options can be passed to plugin:
true
orfalse
.String|Number|Boolean
- details below.Plugin handles
Buffer
s andStream
s.Actually tried to make
threshold
option pretty handy - it can receiveString
(parsed bybytes
, hard limited in 150),Number
(exact size in bytes, hard limited in 150),Boolean
(false - compress independently on size, true - resulting hard limit - 150).Also replaced event-stream with through2 - reason is that ev built with Streams1 in mind and during extending of your plugin, I had couple of problems because of incapability of ev with Streams2.
Also rewritten tests - including originals with addition of test suit for extended capabilities. Now for testing you can use
npm test
/gulp
. Also added as dev-dependency gulp with little zoo of plugins allowing to livecode while testing.Also added
example
folder demonstrating few usage scenarios.