hyperdrive
Advanced tools
Comparing version 11.0.0-alpha.16 to 11.0.0-alpha.17
17
index.js
@@ -245,2 +245,15 @@ const Hyperbee = require('hyperbee') | ||
async purge () { | ||
if (this._checkout || this._batching) { | ||
throw new Error('Can only purge the main session') | ||
} | ||
await this.ready() // Ensure blobs loaded if present | ||
await this.close() | ||
const proms = [this.core.purge()] | ||
if (this.blobs) proms.push(this.blobs.core.purge()) | ||
await Promise.all(proms) | ||
} | ||
async symlink (name, dst, { metadata = null } = {}) { | ||
@@ -256,2 +269,6 @@ return this.files.put(normalizePath(name), { executable: false, linkname: dst, blob: null, metadata }) | ||
async exists (name) { | ||
return await this.entry(name) !== null | ||
} | ||
diff (length, folder, opts) { | ||
@@ -258,0 +275,0 @@ if (typeof folder === 'object' && folder && !opts) return this.diff(length, null, folder) |
{ | ||
"name": "hyperdrive", | ||
"version": "11.0.0-alpha.16", | ||
"version": "11.0.0-alpha.17", | ||
"description": "Hyperdrive is a secure, real-time distributed file system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -134,2 +134,6 @@ # Hyperdrive | ||
#### `const exists = await drive.exists(path)` | ||
Returns `true` if the entry at `path` does exists, otherwise `false`. | ||
#### `await drive.del(path)` | ||
@@ -161,2 +165,6 @@ | ||
#### `await drive.purge()` | ||
Purge both cores (db and blobs) from your storage, completely removing all the drive's data. | ||
#### `await drive.symlink(path, linkname)` | ||
@@ -163,0 +171,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34391
418
324