Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Documentation update.

  • Loading branch information...
commit c32d7359477429dba9c965f1cea4acd136a3f720 1 parent 1cbed2c
@egorich239 authored
Showing with 54 additions and 117 deletions.
  1. +32 −0 HISTORY
  2. +1 −1  LICENSE
  3. +20 −115 README
  4. +1 −1  wscript
View
32 HISTORY
@@ -0,0 +1,32 @@
+2010-06-05 v0.1.5
+ * README updated.
+ * HISTORY created.
+ * Build in release instead of debug.
+
+2010-06-05 v0.1.4
+ * Report about OOM errors.
+ * Some code enhancements.
+
+2010-06-05 v0.1.3
+ * (De-)compression is performed asynchronously.
+
+2010-05-15 v0.1.2
+ * Multiple code improvements.
+ * tests/ renamed to demo/
+
+2010-05-10 v0.1.1
+ * Streams support.
+
+2010-05-10 v0.1.0, v0.1.0+
+ * Made all compression/decompression classes utilize single JS interface.
+ * Source directory re-organization.
+ * Started moving common code for gzip/bzip to separate class.
+ * (v0.1.0+) README updated.
+
+2010-05-10 v0.0.2, v0.0.3
+ * Memory leak fixed.
+ * Bzip library support added.
+
+2010-05-08
+ * Forked from original waveto's implementation.
+
View
2  LICENSE
@@ -1,5 +1,5 @@
// Copyright 2009, Acknack Ltd. All rights reserved.
-// Copyright 2010, Ivan Egorov.
+// Copyright 2010, Ivan Egorov (egorich.3.04@gmail.com).
// 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
View
135 README
@@ -1,128 +1,33 @@
-node-compress
-=============
+About
+=====
-A streaming compression module for node.js.
-Note, that API has changed since v0.1.0 and is compatible with original API by
-waveto no more.
-Since v0.1.1 supports streams API.
+Asynchronous streaming compression module for node.js.
-Supports gzip and bzip2 compression/decompression.
-
-To install, ensure that you have libz and libbz2 installed, and run:
-
-node-waf configure
-node-waf build
-
-This will put the compress-bindings.node binary module in build/default.
-By default library would be built with gzip support only.
-Use --with-bzip key to configure library with bzip support.
-Use --no-gzip key to configure library without gzip support.
-
-
-Quick example
--------------
-
-var compress=require("../compress-bindings");
-var sys=require("sys");
-var posix=require("fs");
-var Buffer = require('buffer').Buffer;
-
-function createBuffer(str, enc) {
- enc = enc || 'utf8';
- var len = Buffer.byteLength(str, enc);
- var buf = new Buffer(len);
- buf.write(str, enc, 0);
- return buf;
-}
+Note, that API has changed since forked from original project by waveto. See
+HISTORY for more details.
+Currently library supports two compression backends: gzip and bzip2.
-// Create gzip stream
-var gzip=new compress.Gzip(4);
-
-// Pump data to be compressed
-var gzdata1, gzdata2, gzdata3;
-gzip.write(createBuffer("My data that needs "), function(err, data) {
- gzdata1 = data;
-});
-sys.puts("Compressed size : "+gzdata1.length);
-
-gzip.write(createBuffer("to be compressed. 01234567890."), function(err, data) {
- gzdata2 = data;
-});
-sys.puts("Compressed size : "+gzdata2.length);
-
-gzip.close(function(err, data) {
- gzdata3 = data;
-});
-sys.puts("Last bit : "+gzdata3.length);
-
-// Take the output stream, and chop it up into two
-var gzdata = gzdata1+gzdata2+gzdata3;
-sys.puts("Total compressed size : "+gzdata.length);
-var d1 = gzdata.substr(0, 25);
-var d2 = gzdata.substr(25);
-
-// Create gunzip stream to decode these
-var data1, data2, data3;
-var gunzip = new compress.Gunzip;
-gunzip.write(createBuffer(d1, 'binary'), function(err, data) {
- data1 = data;
-});
-gunzip.write(createBuffer(d2, 'binary'), function(err, data) {
- data2 = data;
-});
-gunzip.close(function(err, data) {
- data3 = data;
-});
-
-sys.puts(data1+data2+data3);
+To install, ensure that you have libz and libbz2 installed, and run:
-Quick streams example
----------------------
+Build
+=====
-var compress=require("../compress");
-var sys=require("sys");
-var posix=require("fs");
-var Buffer = require('buffer').Buffer;
+node-waf configure
+node-waf build
-sys.puts('Compressing...');
-var gzdata = '';
-var gzip=new compress.GzipStream();
-gzip.setInputEncoding('utf8');
-gzip.setEncoding('binary');
-gzip.addListener('data', function(data) {
- gzdata += data;
-}).addListener('error', function(err) {
- throw err;
-}).addListener('end', function() {
- sys.puts('Compressed length: ' + gzdata.length);
-});
+Configuration options:
+ --with-gzip Build with gzip support. Default.
+ --no-gzip Build w/o gzip support.
+ --with-bzip Build with bzip support.
+ --no-bzip Build w/o bzip support. Default.
-gzip.write("My data that needs ");
-gzip.write("to be compressed. 01234567890.");
-gzip.close();
-sys.puts('Compression finished.');
+Build puts the compress-bindings.node binary module in build/default.
-var d1 = gzdata.substr(0, 25);
-var d2 = gzdata.substr(25);
+Usage examples
+--------------
-sys.puts('Decompressing...');
-var rawdata = '';
-var gunzip = new compress.GunzipStream();
-gunzip.setInputEncoding('binary');
-gunzip.setEncoding('utf8');
-gunzip.addListener('data', function(data) {
- rawdata += data;
-}).addListener('error', function(err) {
- throw err;
-}).addListener('end', function() {
- sys.puts('Decompressed length: ' + rawdata.length);
- sys.puts('Raw data: ' + rawdata);
-});
-gunzip.write(d1);
-gunzip.write(d2);
-gunzip.close();
-sys.puts('Decompression finished.');
+See demo/async-test.js.
View
2  wscript
@@ -4,7 +4,7 @@ from os.path import exists
srcdir = "."
blddir = "build"
-VERSION = "0.1.1"
+VERSION = "0.1.5"
def set_options(opt):
opt.tool_options("compiler_cxx")
Please sign in to comment.
Something went wrong with that request. Please try again.