1.0.0-alpha.22 • Published 2 years ago

@synonymdev/slashdrive v1.0.0-alpha.22

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

slashdrive

Drivestore is a Hyperdrive factory that makes it easier to manage large collections of named Hyperdrives.

Features

  • Public unencrypted drive
  • Creates and keep track of all created encrypted private drives

Installation

npm install @synonymdev/slashdrive

Usage

import Corestore from 'corestore'
import Drivestore from '@synonymdev/slashdrive'

const corestore = new Corestore('./corestore_dir')
const store = new Drivestore(corestore, keyPair)

const publicDrive = store.get('public') // or store.get()

const privateDrive = store.get('foo') // returns an encrypted Hyperdrive

API

const drivestore = new Drivestore(corestore, keyPair)

Create new Drivestore.

  • corestore must be an instance of Corestore.

    If the instance is a namespace, the internal corestore will reset its namespace to the DEFAULT_NAMESPACE (32 0-bytes).

  • keyPair public and secret keys to create the public Hyperdrive, the secret key will be used as the primaryKey for the internal corestore.

await drivestore.ready()

Awaits opening metadata hypercore. Useful before async iterating over all created drives.

const hyperdrive = drivestore.get([name])

Returns an encrypted Hyperdrive for a given name.

If name is undefined or equal to /public it will return a public unencrypted drive, by the same keypair passed to the contsructor.

const stream = drivestore.replicate(stream)

Same as drivestore.corestore.replicate(stream)

1.0.0-alpha.22

2 years ago

1.0.0-alpha.21

2 years ago

1.0.0-wip.1

2 years ago

1.0.0-wip.2

2 years ago

1.0.0-alpha.19

3 years ago

1.0.0-alpha.20

3 years ago

1.0.0-alpha.16

3 years ago

1.0.0-alpha.18

3 years ago

1.0.0-alpha.17

3 years ago

1.0.0-alpha.9

3 years ago

1.0.0-alpha.8

3 years ago

1.0.0-alpha.7

3 years ago

1.0.0-alpha.6

3 years ago

1.0.0-alpha.10

3 years ago

1.0.0-alpha.15

3 years ago

1.0.0-alpha.12

3 years ago

1.0.0-alpha.11

3 years ago

1.0.0-alpha.14

3 years ago

1.0.0-alpha.13

3 years ago

1.0.0-alpha.5

3 years ago

1.0.0-alpha.4

3 years ago

1.0.0-alpha.3

3 years ago

1.0.0-alpha.2

3 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha.0

3 years ago