Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/okdistribute/zip-to-hyperdrive
Add files from a zip archive to a hyperdrive archive.
https://github.com/okdistribute/zip-to-hyperdrive
Last synced: 25 days ago
JSON representation
Add files from a zip archive to a hyperdrive archive.
- Host: GitHub
- URL: https://github.com/okdistribute/zip-to-hyperdrive
- Owner: okdistribute
- Created: 2016-12-01T07:48:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-01T08:31:44.000Z (almost 8 years ago)
- Last Synced: 2024-05-16T13:19:07.102Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-dat - zip-to-hyperdrive - import contents of a zip archive into a hyperdrive archive (Outdated / Other Related Dat Project Modules)
README
# zip-to-hyperdrive
Add files from a zip archive to a hyperdrive archive.
[![Travis](https://api.travis-ci.org/karissa/zip-to-hyperdrive.svg)](https://travis-ci.org/karissa/zip-to-hyperdrive)
```
npm install zip-to-hyperdrive
```## Example
```js
var hyperzip = require('zip-to-hyperdrive')
var hyperdrive = require('hyperdrive')
var memdb = require('memdb')var drive = hyperdrive(memdb())
var archive = drive.createArchive()function done (err) {
console.log('files added!')
}hyperzip('/path/to/zipfile.zip', archive, done)
```## API
#### hyperzip(zipfile, archive, [cb])
Adds files to the given archive. The `cb` will be called once all files have been read and their contents added to the hyperdrive archive.
`zipfile` can be a path to a file on the local filesystem, a `yauzl` zipfile object, or a `Buffer`.