Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated file readme to readme.md #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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 build

This 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);