Permalink
Browse files

first commit

  • Loading branch information...
0 parents commit 9fcd7432d6b13accc4b9ed777e57ab4388af790c @waveto waveto committed Nov 22, 2009
Showing with 544 additions and 0 deletions.
  1. +18 −0 LICENSE
  2. +37 −0 README
  3. +377 −0 compress.cc
  4. +41 −0 filetest.js
  5. +38 −0 test.js
  6. +33 −0 wscript
18 LICENSE
@@ -0,0 +1,18 @@
+// Copyright 2009, Acknack Ltd. All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
37 README
@@ -0,0 +1,37 @@
+node-compress
+=============
+
+A streaming compression / gzip module for node.js
+
+To install, ensure that you have openssl 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);
Oops, something went wrong.

0 comments on commit 9fcd743

Please sign in to comment.