You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: packages/drive/README.md
-52Lines changed: 0 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,55 +2,3 @@
2
2
3
3
[DEPRECATED] use `@synonymdev/slashtags-core-data` instead.
4
4
5
-
Drivestore is a Hyperdrive factory that makes it easier to manage large collections of named Hyperdrives.
6
-
7
-
## Features
8
-
9
-
- Public unencrypted drive
10
-
- Creates and keep track of all created encrypted private drives
11
-
12
-
## Installation
13
-
14
-
```
15
-
npm install @synonymdev/slashdrive
16
-
```
17
-
18
-
## Usage
19
-
20
-
```js
21
-
importCorestorefrom'corestore'
22
-
importDrivestorefrom'@synonymdev/slashdrive'
23
-
24
-
constcorestore=newCorestore('./corestore_dir')
25
-
conststore=newDrivestore(corestore, keyPair)
26
-
27
-
constpublicDrive=store.get('public') // or store.get()
28
-
29
-
constprivateDrive=store.get('foo') // returns an encrypted Hyperdrive
30
-
```
31
-
32
-
## API
33
-
34
-
#### `const drivestore = new Drivestore(corestore, keyPair)`
35
-
36
-
Create new Drivestore.
37
-
38
-
-`corestore` must be an instance of [Corestore](https://github.com/hypercore-protocol/corestore).
39
-
40
-
If the instance is a [namespace](https://github.com/hypercore-protocol/corestore#const-store--storenamespacename), the internal corestore will reset its namespace to the `DEFAULT_NAMESPACE` (32 0-bytes).
41
-
42
-
-`keyPair` public and secret keys to create the public Hyperdrive, the secret key will be used as the `primaryKey` for the internal corestore.
43
-
44
-
#### `await drivestore.ready()`
45
-
46
-
Awaits opening metadata hypercore. Useful before [async iterating](#for-await-let-name-of-drivestore) over all created drives.
47
-
48
-
#### `const hyperdrive = drivestore.get([name])`
49
-
50
-
Returns an encrypted [Hyperdrive](https://github.com/hypercore-protocol/hyperdrive-next) for a given name.
51
-
52
-
If `name` is undefined or equal to `/public` it will return a public unencrypted drive, by the same keypair passed to the contsructor.
0 commit comments