{"_id":"@synonymdev/hyperdrive","_rev":"28-2a583213cea8b82fc67338517277b7c4","name":"@synonymdev/hyperdrive","dist-tags":{"latest":"11.0.0-alpha.13"},"versions":{"11.0.0-alpha.10":{"name":"@synonymdev/hyperdrive","version":"11.0.0-alpha.10","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"@synonymdev/hyperdrive@11.0.0-alpha.10","maintainers":[{"name":"instasynonym","email":"instabot.npm@proton.me"},{"name":"pwltr","email":"philippwalter@pm.me"},{"name":"miguelmedeirosweb","email":"miguel@miguelmedeiros.com.br"},{"name":"rbndg","email":"rbandegi@gmail.com"},{"name":"chm-diederichs","email":"chm-diederichs@protonmail.com"},{"name":"bitcoinerrorlog","email":"john@synonym.to"},{"name":"jayvdb","email":"jayvdb1@gmail.com"},{"name":"coreyphillips","email":"corey.lyle.phillips@gmail.com"},{"name":"gr0kchain","email":"gr0kchain@protonmail.com"},{"name":"nzh","email":"ar.nazeh@gmail.com"}],"homepage":"https://github.com/hypercore-protocol/hyperdrive-next#readme","bugs":{"url":"https://github.com/hypercore-protocol/hyperdrive-next/issues"},"dist":{"shasum":"844bfc6108c34d1fd8de01a500b1a38f86ada19e","tarball":"https://registry.npmjs.org/@synonymdev/hyperdrive/-/hyperdrive-11.0.0-alpha.10.tgz","fileCount":4,"integrity":"sha512-xaNz442l4cv5bIr6meHQSi1WYSpd/S+YJttvFWw6BqBkvI72ytiHZjmE5s8oUV6xEWGTMQ7n7NW/Rfn3tMz0vA==","signatures":[{"sig":"MEUCIQCmOqocKVNjLrl/34x+aCcj6ZLHbt96J1VctCx3OuBsnQIgWaqKZJaHhwi/uaPYWs4uL09p/KnXQZF9d1rKURFb/hs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRWufACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSUA//Waib2Hbi5o+CQATmWFr9tkJFi6TiWdCxIbIvfVWXDLDWQZsC\r\nGUOA5IHLQm4ZzhC0cn0br+Tq/Rksl/Q228yrEW5YRZ1bztn7xAf09VH6pVkN\r\nujhJAMfFNRaNYfRR3GkcVzsGyt1IX02LZ0qSiT/m1HH4RVLJqU+q9aZ4L+Ig\r\naesXrFYZWYSzE0CuyMHa9Vm/rLRhwdaX1a1OaeS3AEuz/C6JbATZAe3NgLrl\r\najcjlBbU/UyBpkvP4tFE1yzMfM4mAxzb1rctOwUhfKgs8OU2NwAEds7EraV0\r\n2skYb0uuYRlJpzwiz53W3sYkxCtr7DD8AF7rNnEoOfNiGCoS+THxDycWmgLD\r\nOXGg7s42AOOQQPDJR6xMaVwlK8QknKoeWEXSbX0goSJiL8YytPZ/Bsfnugjy\r\nlacZM0frY8oe4Rx7DV8XLdw7WIj6tbQt2olVMN433vJ7L+7GPOHLlW+2S1n6\r\namp0eVli/K3bbjsmrArz3mQb3Ql9KQoOKmh8t2FC1RT8yOMiBWT4/elmi0rI\r\nFmFUVzY86S7kMeh+A5Wsi0N1I2no19YL7rW/Tl7C/iC6F5giTFycFJjynbIh\r\n2AH/Q+dDQMOHspZp2MkkrIA7qppRqE38ct702NsUbrrz1peJrwUQJ+dz9cV5\r\nbxMA3d2p30+fJ3DfPJNcNFqGqCHeX9CzLiQ=\r\n=hIIW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"21f2e0206f9836398372a2edaa5acd42b8f9f4ee","scripts":{"test":"standard && brittle test.js"},"_npmUser":{"name":"nzh","email":"ar.nazeh@gmail.com"},"repository":{"url":"git+https://github.com/hypercore-protocol/hyperdrive-next.git","type":"git"},"_npmVersion":"8.15.0","description":"Hyperdrive is a secure, real-time distributed file system","directories":{},"_nodeVersion":"18.7.0","dependencies":{"streamx":"^2.12.4","hyperbee":"^2.1.1","hyperblobs":"^2.0.0","is-options":"^1.0.2","unix-path-resolve":"^1.0.2"},"_hasShrinkwrap":false,"devDependencies":{"b4a":"^1.6.0","brittle":"^3.1.0","standard":"^17.0.0","corestore":"^6.1.1","hyperswarm":"^4.0.0","@hyperswarm/dht":"^6.2.0","hypercore-crypto":"^3.2.1","@hyperswarm/testnet":"^3.0.0","random-access-memory":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hyperdrive_11.0.0-alpha.10_1665493918835_0.9400631990165143","host":"s3://npm-registry-packages"}},"11.0.0-alpha.12":{"name":"@synonymdev/hyperdrive","version":"11.0.0-alpha.12","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"@synonymdev/hyperdrive@11.0.0-alpha.12","maintainers":[{"name":"instasynonym","email":"instabot.npm@proton.me"},{"name":"pwltr","email":"philippwalter@pm.me"},{"name":"miguelmedeirosweb","email":"miguel@miguelmedeiros.com.br"},{"name":"rbndg","email":"rbandegi@gmail.com"},{"name":"chm-diederichs","email":"chm-diederichs@protonmail.com"},{"name":"bitcoinerrorlog","email":"john@synonym.to"},{"name":"jayvdb","email":"jayvdb1@gmail.com"},{"name":"coreyphillips","email":"corey.lyle.phillips@gmail.com"},{"name":"gr0kchain","email":"gr0kchain@protonmail.com"},{"name":"nzh","email":"ar.nazeh@gmail.com"}],"homepage":"https://github.com/hypercore-protocol/hyperdrive-next#readme","bugs":{"url":"https://github.com/hypercore-protocol/hyperdrive-next/issues"},"dist":{"shasum":"4deea364d4266a66b12130d6e923b598e2147d94","tarball":"https://registry.npmjs.org/@synonymdev/hyperdrive/-/hyperdrive-11.0.0-alpha.12.tgz","fileCount":4,"integrity":"sha512-XiAXRL8NIJJbBQI+Q/58adZuKmaIfvOeIREd5TJXGEMl03dXfKnNLcAN8mx4jPT9iMNvSZ0Knd+tj7iaca8aOA==","signatures":[{"sig":"MEQCIBxN67fF/p2HgL48OngjbeKjS+Xxy9JnCOjXSTVKgYMeAiBmBfJndvhZ9kmJsaHc+d5KFydT0pxE1IfSgmjpza5sRA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRl7iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrE7w//QEtiJtc97I35r6Xn57fVrsfXcOIfI8R4K6Hbb/cZuQjR+fhi\r\nmjdPG7UiOWTJXPEhhaLOjmUG+9hSquJM2uFpp7mCV3N7aSd0E3Z0hzjbU5PL\r\nE9QaNQtOSbgAVxI2IwU9It/UMt9Cw5TOjxbQxcRCaLHZwMmMJx41Z8sVuhUB\r\n1ctfQx2JOWSwSC8IBdmcj4D7SxPthjMpIgXWVnQIvkYztIZvst7onchFR1B7\r\nPaggTIPOxnoGVSbjJIqTBfeTfBetfQKllNyr+W0XFmSuQb07tEmxMVV1JIbM\r\nqq0f9McRnMMll5AD0PI+pGtynmawrr4atoeRiWICS9nGc9gvMbD2SALO0zO7\r\n4dZ/mh9dzC8K1QNhMJcwPaG9LNKJLKCiR/A89N3UZ+iznEFc6oWGNKfS4dZF\r\n15lQvrbfEFsuZjPV7mNhfgTIlQTrTWtYyelWV8Vxy7wVlLdmEWD3y8x+GsbR\r\n9yU7Eh/S/mwFEtusCjWzKEJMBTiohxmCZ75YPxQWOn/gp9O1GQ7uxMzRTf1C\r\nw+cF/7dbQhkZYq38M4YUvY8XLZKePXIs037aYJIh7M54yu+/is/npU8AXX37\r\n6hyk9CgCp54YDS8mLXdwIpAe1euZdhxwYrZ/cW+bLCfTC71D5lCUTGKyV+Dr\r\nJLDT1ocPgbi1O1Yrw8+5I+e3OIYp3w8RW7w=\r\n=fuFK\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"83559ef35be3316d3f438c1ad0f7ed8777e9ec7f","scripts":{"test":"standard && brittle test.js"},"_npmUser":{"name":"nzh","email":"ar.nazeh@gmail.com"},"repository":{"url":"git+https://github.com/hypercore-protocol/hyperdrive-next.git","type":"git"},"_npmVersion":"8.15.0","description":"Hyperdrive is a secure, real-time distributed file system","directories":{},"_nodeVersion":"18.7.0","dependencies":{"streamx":"^2.12.4","hyperbee":"^2.1.1","hyperblobs":"^2.0.0","is-options":"^1.0.2","unix-path-resolve":"^1.0.2"},"_hasShrinkwrap":false,"devDependencies":{"b4a":"^1.6.0","brittle":"^3.1.0","standard":"^17.0.0","corestore":"^6.1.1","hyperswarm":"^4.0.0","@hyperswarm/dht":"^6.2.0","hypercore-crypto":"^3.2.1","@hyperswarm/testnet":"^3.0.0","random-access-memory":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hyperdrive_11.0.0-alpha.12_1665556193799_0.9850282155331742","host":"s3://npm-registry-packages"}},"11.0.0-alpha.13":{"name":"@synonymdev/hyperdrive","version":"11.0.0-alpha.13","author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","_id":"@synonymdev/hyperdrive@11.0.0-alpha.13","maintainers":[{"name":"instasynonym","email":"instabot.npm@proton.me"},{"name":"pwltr","email":"philippwalter@pm.me"},{"name":"miguelmedeirosweb","email":"miguel@miguelmedeiros.com.br"},{"name":"rbndg","email":"rbandegi@gmail.com"},{"name":"chm-diederichs","email":"chm-diederichs@protonmail.com"},{"name":"bitcoinerrorlog","email":"john@synonym.to"},{"name":"jayvdb","email":"jayvdb1@gmail.com"},{"name":"coreyphillips","email":"corey.lyle.phillips@gmail.com"},{"name":"gr0kchain","email":"gr0kchain@protonmail.com"},{"name":"nzh","email":"ar.nazeh@gmail.com"}],"homepage":"https://github.com/hypercore-protocol/hyperdrive-next#readme","bugs":{"url":"https://github.com/hypercore-protocol/hyperdrive-next/issues"},"dist":{"shasum":"17734a470dea811d17606fffd376fce9084f1e92","tarball":"https://registry.npmjs.org/@synonymdev/hyperdrive/-/hyperdrive-11.0.0-alpha.13.tgz","fileCount":4,"integrity":"sha512-nDGPmD6J+z64pJxWA7SfjnUHGcctTpZZxEwMWcPgG3Y9NqLx8GHR/I2RdpBPO8xxPXTs/muIIL2rdu5biSutQQ==","signatures":[{"sig":"MEUCICBxXILphz9iwFAeaQuxNiyvO8PHw0sTL962YEvyaGRrAiEAoMLMY21z3CNgj40xl2UJiM8xjSJIDM7n8JXRkCUSd0k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRmCxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp75hAAger5+a8d3TTEJuqBayrrDviMi+OIMhh0tFJ7GrNLw5ga/tDP\r\n4pzEI3y/ZnzSvT3wX44HN/6pei6mQk4W6HoipOYh5B+Y2V0PpI/Rgh8+qgMA\r\n8ER/R41nYAX2B1PvP1Jrq2GUDEaUS2VF0Go8z2h/JLLs/8AigRle0RHWp+fQ\r\nni7o+jPG8rpE+uhUPdFdp7oCo9Q97ZvkYyv6+p3k3UKzFOjDgyJn9JHJyIm1\r\ncTus9zz8OHI+CM7GZGTLkpjc1umCbDtttQBWtnBdmxUglDbZLeqzNcceYWws\r\n4e2QbaWHmGBI+m/poDBhl8UutWPudffthav7VQISUSy8ilDuFVa5IyuLOx/m\r\nyhzsgw+ms5jwBOSIiOFrv1fcmQxExMaTDZfRZ7rvnYbLGeR2GTHHN1+qG32S\r\nZjTXAbroNg85Wd8uW5HUjDOhHEAbIRGmftY2YpWbqTuXscdQ325+ZlX0eo2V\r\nl988KprSPu6oHyty1RyVgHaS8k8BkO81YvJ1+yoes/qsrxJRTEpaYZwxXGTz\r\n6+xxF7jyPGRVXEPhlpF0iFHhNRS87L0KDjcj7Q+Q1Ib1v5jEHS3g94/P9JkL\r\nRpj4sDFvQ+SuZE3ZhN4cn3N843RC4uL2j7cBdwYVHoFLrDZC5BPwzMYM8rZb\r\n9PzuFrVNDXNcvb+P66OuzyyC8UIZ0GjvD4Y=\r\n=vO2X\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"83559ef35be3316d3f438c1ad0f7ed8777e9ec7f","scripts":{"test":"standard && brittle test.js"},"_npmUser":{"name":"nzh","email":"ar.nazeh@gmail.com"},"repository":{"url":"git+https://github.com/hypercore-protocol/hyperdrive-next.git","type":"git"},"_npmVersion":"8.15.0","description":"Hyperdrive is a secure, real-time distributed file system","directories":{},"_nodeVersion":"18.7.0","dependencies":{"keypear":"^1.1.1","streamx":"^2.12.4","hyperbee":"^2.1.1","hyperblobs":"^2.0.0","is-options":"^1.0.2","unix-path-resolve":"^1.0.2"},"_hasShrinkwrap":false,"devDependencies":{"b4a":"^1.6.0","brittle":"^3.1.0","standard":"^17.0.0","corestore":"^6.1.1","hyperswarm":"^4.0.0","@hyperswarm/dht":"^6.2.0","hypercore-crypto":"^3.2.1","@hyperswarm/testnet":"^3.0.0","random-access-memory":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hyperdrive_11.0.0-alpha.13_1665556657750_0.3817978007865688","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-10-11T13:11:58.835Z","modified":"2026-09-07T09:46:25.138Z","11.0.0-alpha.10":"2022-10-11T13:11:59.012Z","11.0.0-alpha.12":"2022-10-12T06:29:54.116Z","11.0.0-alpha.13":"2022-10-12T06:37:37.923Z"},"bugs":{"url":"https://github.com/hypercore-protocol/hyperdrive-next/issues"},"author":{"url":"@mafintosh","name":"Mathias Buus"},"license":"MIT","homepage":"https://github.com/hypercore-protocol/hyperdrive-next#readme","repository":{"url":"git+https://github.com/hypercore-protocol/hyperdrive-next.git","type":"git"},"description":"Hyperdrive is a secure, real-time distributed file system","maintainers":[{"email":"pavel@synonym.to","name":"thisispav"},{"email":"john@synonym.to","name":"bitcoinerrorlog"},{"email":"corey.lyle.phillips@gmail.com","name":"coreyphillips"},{"email":"philippwalter@pm.me","name":"pwltr"},{"email":"deniszalessky@gmail.com","name":"dzdidi_restored"},{"email":"octrif@gmail.com","name":"ovitrif"},{"email":"crequena2@gmail.com","name":"shacollision"},{"email":"jamesbrowning91@gmail.com","name":"catch-21"},{"email":"oier@synonym.to","name":"tipogi"},{"email":"andrei@synonym.to","name":"andrei-synonym"},{"email":"tomos@synonym.to","name":"86667-tomos"},{"email":"jayvdb1@gmail.com","name":"jayvdb"},{"email":"sevi_buehler@hotmail.com","name":"sebubu"}],"readme":"# Hyperdrive\n\nHyperdrive is a secure, real-time distributed file system\n\n## Install\n\n```sh\nnpm install hyperdrive@next\n```\n\nNote this is the Hyperdrive 11 preview based on Hypercore 10\n\n## Usage\n\n```js\nconst Hyperdrive = require('hyperdrive')\nconst Corestore = require('corestore')\n\nconst corestore = new Corestore('storage')\n\nconst drive = new Hyperdrive(corestore, /* optionalKey */)\n\nconst ws = drive.createWriteStream('/blob.txt')\n\nws.write('Hello, ')\nws.write('world!')\nws.end()\n\nws.on('close', function () {\n  const rs = drive.createReadStream('/blob.txt')\n  rs.pipe(process.stdout) // prints Hello, world!\n})\n```\n\n## API\n\n#### `const drive = new Hyperdrive(corestore, [key])`\n\nCreates a new Hyperdrive instance.\n\n`corestore` must be an instance of `Corestore`.\n\n`key` should be a Hypercore public key. If you do not set this, Hyperdrive will use the core at `{ name: 'db' }` in the passed Corestore instance.\n\n#### `await drive.ready()`\n\nWait for the drive to fully open. In general, you do **NOT** need to wait for `ready` unless checking a synchronous property on `drive` since internals `await` this themselves.\n\n#### `const buffer = await drive.get(path)`\n\nReturns the blob at `path` in the drive. Internally, Hyperdrive contains a metadata index of entries that \"point\" to offsets in a `Hyperblobs` instance. Blobs themselves are accessible via `drive.get(path)`, whereas entries are accessible via `drive.entry(path)`. If no blob exists at `path`, returns `null`.\n\n#### `const stream = drive.createReadStream(path, options)`\n\nReturns a stream that can be used to read out the blob stored in the drive at `path`.\n\n`options` are the same as the `options` to `Hyperblobs().createReadStream(path, options)`.\n\n#### `const entry = await drive.entry(path)`\n\nReturns the entry at `path` in the drive. An entry holds metadata about a `path`, currently:\n\n```js\n{\n  seq: Number,\n  key: String,\n  value: {\n    executable: Boolean, // whether the blob at path is an executable\n    linkname: null // if entry not symlink, otherwise a string to the entry this links to\n    blob: { // a Hyperblob id that can be used to fetch the blob associated with this entry\n      blockOffset: Number,\n      blockLength: Number,\n      byteOffset: Number,\n      byteLength: Number\n    },\n    metadata: null\n  }\n}\n```\n\n#### `await drive.symlink(path, linkname)`\n\nCreates an entry in drive at `path` that points to the entry at `linkname`. Note, if a blob entry currently exists at `path` then `drive.symlink(path, linkname)` will overwrite the entry and `drive.get(path)` will return `null`, while `drive.entry(path)` will return the entry with symlink information.\n\n#### `const hyperblobs = await drive.getBlobs()`\n\nReturns the hyperblobs instance storing the blobs indexed by drive entries.\n\n```js\nconst fs = require('fs')\nconst Corestore = require('corestore')\nconst Hyperdrive = require('hyperdrive')\n\nconst drive = new Hyperdrive(new Corestore('storage'))\n\nawait drive.put(__filename, fs.readFileSync(__filename))\nconst bufFromGet = await drive.get(__filename)\n\nconst { value: entry } = await drive.entry(__filename)\nconst blobs = await drive.getBlobs()\nconst bufFromEntry = blobs.get(entry.blob)\n\nconsole.log(Buffer.compare(bufFromGet, bufFromEntry)) // prints 0\n```\n\n#### `const stream = await drive.entries([options])`\n\nReturns a read stream of entries in the drive.\n\n`options` are the same as the `options` to `Hyperbee().createReadStream(options)`.\n\n#### `await drive.put(path, blob, [options])`\n\nSets the `blob` in the drive at `path`.\n\n`path` should be a `utf8` string.\n`blob` should be a `Buffer`.\n\n`options` includes:\n\n```js\n{\n  executable: true | false // whether the blob is executable or not\n}\n```\n\n#### `ws = drive.createWriteStream(path, [options])`\n\nStream a blob into the drive at `path`. Options include\n\n```js\n{\n  executable: true | false // whether the blob is executable or not\n}\n```\n\n#### `await drive.del(path)`\n\nRemoves the `entry` at `path` from the drive. If a blob corresponding to the entry at `path` exists, it is not currently deleted.\n\n\n#### `const hypercore = drive.core`\n\nThe underlying Hypercore backing the drive.\n\n#### `const buffer = drive.key`\n\nThe public key of the Hypercore backing the drive.\n\n#### `const buffer = drive.discoveryKey`\n\nThe hash of the public key of the Hypercore backing the drive, can be used to seed the drive using Hyperswarm.\n\n#### `const buffer = drive.contentKey`\n\nThe public key of the Hyperblobs instance holding blobs associated with entries in the drive.\n\n#### `const integer = drive.version`\n\nThe version (offset in the underlying Hypercore) of the drive.\n\n#### `const Hyperdrive = drive.checkout(version)`\n\nChecks out a read-only snapshot of a Hyperdrive at a particular version.\n\n```js\nconst fs = require('fs')\nconst Corestore = require('corestore')\nconst Hyperdrive = require('hyperdrive')\n\nconst drive = new Hyperdrive(new Corestore('storage'))\n\nawait drive.put('/fst-file.txt', fs.readFileSync('fst-file.txt'))\n\nconst version = drive.version\n\nawait drive.put('/snd-file.txt', fs.readFileSync('snd-file.txt'))\n\nconst snapshot = drive.checkout(version)\n\nconsole.log(await drive.get('/snd-file.txt')) // prints Buffer\nconsole.log(await snapshot.get('/snd-file.txt')) // prints null\nconsole.log(Buffer.compare(await drive.get('/fst-file.txt'), await snapshot.get('/fst-file.txt'))) // prints 0\n```\n\n#### `const stream = drive.diff(version, folder, [options])`\nEfficiently create a stream of the shallow changes to `folder` between `version` and `drive.version`. Each entry is sorted by key and looks like this:\n\n```\n{\n  left: <the entry in folder at drive.version for some path>,\n  right: <the entry in folder at drive.checkout(version) for some path>\n}\n```\n\nIf an entry exists in `drive.version` of the `folder` but not in `version`, then left is set and right will be null, and vice versa.\n\n#### `await drive.downloadDiff(version, folder, [options])`\n\nDownloads all the blobs in `folder` corresponding to entries in `drive.checkout(version)` that are not in `drive.version`. In other words, downloads all the blobs added to `folder` up to `version` of the drive.\n\n#### `const stream = drive.list(folder, [options])`\n\nReturns a stream of all entries in the drive at paths prefixed with `folder`. Options include:\n\n```js\n{\n  recursive: true | false // whether to descend into all subfolders or not\n}\n```\n\n#### `await drive.download(folder, [options])`\n\nDownloads the blobs corresponding to all entries in the drive at paths prefixed with `folder`. Options are the same as those for `drive.list(folder, [options])`.\n\n#### `const stream = drive.readdir(folder)`\n\nReturns a stream of all subpaths of entries in drive stored at paths prefixed by `folder`.\n\n```js\nawait drive.put('/parent/child', Buffer.from('child'))\nawait drive.put('/parent/sibling', Buffer.from('sibling'))\nfor await (const path of drive.readdir('/parent')) console.log(path) // prints \"child\", then prints \"sibling\"\n```\n\n#### `await downloadRange(dbRanges, blobRanges)`\n\nDownloads the entries and blobs stored in the [ranges][core-range-docs] `dbRanges` and `blobRanges`.\n\n#### `const batch = drive.batch()`\n\nAtomically mutate the drive, has the same interface as Hyperdrive.\n\n#### `await batch.flush()`\n\nAtomically commit a batch of mutations to the underlying drive.\n\n#### `await drive.close()`\n\nClose the drive and its underlying Hypercore backed datastructures.\n\n\n[core-range-docs]: https://github.com/hypercore-protocol/hypercore-next#const-range--coredownloadrange\n","readmeFilename":"README.md"}