Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "seek-bzip", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"author": "Eli Skeggs, C. Scott Ananian, Kevin Kwok", | ||
"description": "a pure-javascript Node.JS module for decoding bzip2 data", | ||
"description": "a pure-JavaScript Node.JS module for random-access decoding bzip2 data", | ||
"main": "./seek-bzip/index.js", | ||
@@ -23,3 +23,4 @@ "repository": { | ||
"devDependencies": { | ||
"mocha": "~1.9.0" | ||
"mocha": "~1.9.0", | ||
"fibers": "~1.0.1" | ||
}, | ||
@@ -26,0 +27,0 @@ "scripts": { |
# seek-bzip | ||
`seek-bzip` is a pure-javascript Node.JS module adapted from 'node-bzip' and before that antimatter15's pure-javascript implementation for decoding bzip2 data. `seek-bzip` currently only decodes buffers into other buffers, synchronously. Unlike `node-bzip`, `seek-bzip` can seek to and decode single blocks from the bzip2 file. | ||
[![Build Status](https://travis-ci.org/cscott/seek-bzip.png)](https://travis-ci.org/cscott/seek-bzip) | ||
`seek-bzip` is a pure-javascript Node.JS module adapted from [node-bzip](https://github.com/skeggse/node-bzip) and before that [antimatter15's pure-javascript bzip2 decoder](https://github.com/antimatter15/bzip2.js). Like these projects, `seek-bzip` only does decompression (see [compressjs](https://github.com/cscott/compressjs) if you need compression code). Unlike those other projects, `seek-bzip` can seek to and decode single blocks from the bzip2 file. | ||
`seek-bzip` primarily decodes buffers into other buffers, synchronously. | ||
With the help of the [fibers](https://github.com/laverdet/node-fibers) | ||
package, it can operate on node streams; see `test/stream.js` for an | ||
example. | ||
## How to Install | ||
@@ -16,3 +23,3 @@ | ||
After compressing some example data into `example.bz2`, the following with recreate that original data and save it to `example`. | ||
After compressing some example data into `example.bz2`, the following will recreate that original data and save it to `example`: | ||
@@ -38,2 +45,4 @@ ``` | ||
contains a `bzip-table` tool which will generate bzip2 block start indices. | ||
There is also a pure-JavaScript `seek-bzip-table` tool in this package's | ||
`bin` directory. | ||
@@ -93,10 +102,45 @@ ## Documentation | ||
## Command-line | ||
There are binaries available in bin. The first generates an index of all | ||
the blocks in a bzip2-compressed file: | ||
``` | ||
$ bin/seek-bzip-table test/sample4.bz2 | ||
32 99981 | ||
320555 99981 | ||
606348 99981 | ||
847568 99981 | ||
1089094 99981 | ||
1343625 99981 | ||
1596228 99981 | ||
1843336 99981 | ||
2090919 99981 | ||
2342106 39019 | ||
$ | ||
``` | ||
The first field is the starting position of the block, in bits, and the | ||
second field is the length of the block, in bytes. | ||
The second binary decodes an arbitrary block of a bzip2 file: | ||
``` | ||
$ bin/seek-bunzip -d -b 2342106 test/sample4.bz2 | tail | ||
élan's | ||
émigré | ||
émigré's | ||
émigrés | ||
épée | ||
épée's | ||
épées | ||
étude | ||
étude's | ||
études | ||
$ | ||
``` | ||
Use `--help` to see other options. | ||
## Help wanted | ||
The following improvements to this module would be generally useful. | ||
Improvements to this module would be generally useful. | ||
Feel free to fork on github and submit pull requests! | ||
* Add compression along with decompression. See `micro-bzip` at | ||
http://www.landley.net/code/ | ||
## Related projects | ||
@@ -107,3 +151,3 @@ | ||
Lots of compression/decompression algorithms from the same author as this | ||
module. | ||
module, including bzip2 compression code. | ||
* https://github.com/cscott/lzjb fast LZJB compression/decompression | ||
@@ -110,0 +154,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2108487
36
894
174
2
4