Permalink
Browse files

add travis.yml, refactor Readme.md

  • Loading branch information...
1 parent 8e7fb9e commit d6ad26ab6debf015a17078c3455f3d6985ea476c @kesla committed Dec 6, 2011
Showing with 16 additions and 25 deletions.
  1. +4 −0 .travis.yml
  2. +12 −25 Readme.md
View
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
View
@@ -1,49 +1,36 @@
-# About
+# Node-snappy [![Build Status](https://secure.travis-ci.org/kesla/node-snappy.png)](http://travis-ci.org/kesla/node-snappy)
+
+## About
Node module/wrapper for Google's fast compressor/decompressor: <http://code.google.com/p/snappy/>
Snappy is a compression/decompression library. It does not aim for maximum compression, or compatibility with any other compression library; instead, it aims for very high speeds and reasonable compression. For instance, compared to the fastest mode of zlib, Snappy is an order of magnitude faster for most inputs, but the resulting compressed files are anywhere from 20% to 100% bigger. On a single core of a Core i7 processor in 64-bit mode, Snappy compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec or more.
Snappy is widely used inside Google, in everything from BigTable and MapReduce to our internal RPC systems. (Snappy has previously been referred to as “Zippy” in some presentations and the likes.)
-# Installation
+## Installation
- "npm install snappy"
-# Examples
-## String
+## Examples
+### String
snappy = require('./snappy');
// Use synchronous version
- snappy.compressSync('string to compress', function(err, compressed){
- // result will be string instead of Buffer
- snappy.decompress(compressed, snappy.parsers.string, function(err, result){
- console.log(result);
- }
+ var compressed= snappy.compressSync('string to compress');
+ snappy.decompressSync(compressed, snappy.parsers.string);
+ // result will be string instead of Buffer
+ console.log(result);
}
-## JSON
+### JSON
snappy = require('./snappy');
// Snappy automatically convert json to a string
snappy.compress({"foo": "bar"}, function(err, compressed){
- // result will be json instead of Buffer
snappy.decompress(compressed, snappy.parsers.json, function(err, result){
+ // result will be json instead of Buffer
console.log(result["foo"]);
}
}
-For more examples of the api, see test.coffee
-
-# Version history
-
-- v1.1.1
- - Remove coffeescript and have files as plain javascript.
- - Refactor folder stucture.
-
-- v1.1.0
- - Include snappy-library in the module (needed for nodester etc)
-
-- v1.0.0
- - First version!
-
# License
Copyright (c) 2011 David Björklund

0 comments on commit d6ad26a

Please sign in to comment.