Selectively download files from a hyperdrive archive.
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.
npm install selective-archive
Archive must a a hyperdrive archive with option sparse: true
.
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.
MIT