Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Inspect and uncompress zipfile archives in Node.js
C++ JavaScript Python Makefile Shell Batchfile

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
data
lib
src
.gitignore
LICENSE.txt
Makefile
README.md
configure
package.json
test.js
wscript

README.md

Node-Zipfile

Bindings to libzip for handling zipfiles in node.

Example

> var zipfile = require('zipfile')
> var zf = new zipfile.ZipFile('./data/world_merc.zip')
> zf
{ names: [ 'world_merc.dbf', 'world_merc.prj', 'world_merc.shp', 'world_merc.shx' ],
  count: 4 }
> var buffer = zf.readFileSync('world_merc.prj')
> buffer.toString()
'PROJCS["Google Maps Global Mercator",GEOGCS .... '

Depends

node >= 0.2.4 (development headers)

libzip

Installation

Install libzip:

Debian:

$ sudo apt-get install libzip-dev libzip1

Or from source:

$ wget http://nih.at/libzip/libzip-0.9.3.tar.bz2
$ tar xvf libzip-0.9.3.tar.bz2
$ cd libzip-0.9.3
$ ./configure
$ make
$ sudo make install

Then on linux do:

$ sudo ldconfig

Install node-zipfile:

$ git clone git://github.com/springmeyer/node-zipfile.git
$ cd node-zipfile

If you installed libzip in a custom location then configure like:

$ configure --libzip=/opt/local

Otherwise /usr/ and /usr/local will be searched for libzip:

$ ./configure
$ make
$ sudo make install
$ ./test.js

Make sure the node modules are on your path:

export NODE_PATH=/usr/local/lib/node/

Or you can install via npm:

$ npm install zipfile

License

BSD, see LICENSE.txt

Something went wrong with that request. Please try again.