corestore 6.8.3 → 6.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +31 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Corestore
|
|
2
2
|
|
|
3
|
-
### [See the full API docs at docs.holepunch.to](https://docs.holepunch.to/
|
|
3
|
+
### [See the full API docs at docs.holepunch.to](https://docs.holepunch.to/helpers/corestore)
|
|
4
4
|
|
|
5
5
|
Corestore is a Hypercore factory that makes it easier to manage large collections of named Hypercores.
|
|
6
6
|
|
package/index.js
CHANGED
|
@@ -47,6 +47,37 @@ module.exports = class Corestore extends ReadyResource {
|
|
|
47
47
|
this.ready().catch(safetyCatch)
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// for now just release the lock...
|
|
51
|
+
async suspend () {
|
|
52
|
+
if (this._root !== this) return this._root.suspend()
|
|
53
|
+
|
|
54
|
+
await this.ready()
|
|
55
|
+
|
|
56
|
+
if (this._keyStorage !== null) {
|
|
57
|
+
await new Promise((resolve, reject) => {
|
|
58
|
+
this._keyStorage.suspend((err) => {
|
|
59
|
+
if (err) return reject(err)
|
|
60
|
+
resolve()
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async resume () {
|
|
67
|
+
if (this._root !== this) return this._root.resume()
|
|
68
|
+
|
|
69
|
+
await this.ready()
|
|
70
|
+
|
|
71
|
+
if (this._keyStorage !== null) {
|
|
72
|
+
await new Promise((resolve, reject) => {
|
|
73
|
+
this._keyStorage.open((err) => {
|
|
74
|
+
if (err) return reject(err)
|
|
75
|
+
resolve()
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
50
81
|
findingPeers () {
|
|
51
82
|
let done = false
|
|
52
83
|
this._incFindingPeers()
|