Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waveto/node-compress
A streaming compression / gzip library for node.js
https://github.com/waveto/node-compress
Last synced: 18 days ago
JSON representation
A streaming compression / gzip library for node.js
- Host: GitHub
- URL: https://github.com/waveto/node-compress
- Owner: waveto
- License: mit
- Created: 2009-11-22T23:39:55.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-01-14T15:42:35.000Z (almost 15 years ago)
- Last Synced: 2024-07-31T22:50:42.461Z (3 months ago)
- Language: C++
- Homepage:
- Size: 110 KB
- Stars: 126
- Watchers: 9
- Forks: 49
- Open Issues: 14
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
node-compress
=============A streaming compression / gzip module for node.js
To install, ensure that you have libz installed, and run:
node-waf configure
node-waf buildThis will put the compress.node binary module in build/default.
Quick example
-------------var compress=require("./compress");
var sys=require("sys");
var posix=require("posix");// Create gzip stream
var gzip=new compress.Gzip;
gzip.init();// Pump data to be compressed
var gzdata1 = gzip.deflate("My data that needs ", "binary");
sys.puts("Compressed size : "+gzdata1.length);var gzdata2 = gzip.deflate("to be compressed. 01234567890.", "binary");
sys.puts("Compressed size : "+gzdata2.length);var gzdata3 = gzip.end();
sys.puts("Last bit : "+gzdata3.length);// Normally stream this out as its generated, but just print here
var gzdata = gzdata1+gzdata2+gzdata3;
sys.puts("Total compressed size : "+gzdata.length);