selective-archive

1.0.0 • Public • Published

Selective Archive

Selectively download files from a hyperdrive archive.

Example

  var archive = drive.createArchive(key, {sparse: true})
  var selectiveArchive = SelectiveArchive(archive)
  // Download txt files
  selectiveArchive.download(['**/*.txt'], function (err) {
    console.log('done downloading')
    process.exit(0)
  })

See example.js for full usage example.

Installation

npm install selective-archive

API

var selective = SelectiveArchive(archive)

Archive must a a hyperdrive archive with option sparse: true.

selective.download(anymatch_array, cb)

Download a selection of files, cb fires when download is finished.

anymatch_array can be a file list or any anymatch compatible search strings. The archive metadata is traversed and checked against matches before downloading.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i selective-archive

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • jhand