1.0.0-alpha.22 • Published 10 months ago

@synonymdev/slashdrive v1.0.0-alpha.22

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months 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

10 months ago

1.0.0-alpha.21

1 year ago

1.0.0-wip.1

1 year ago

1.0.0-wip.2

1 year ago

1.0.0-alpha.19

2 years ago

1.0.0-alpha.20

1 year ago

1.0.0-alpha.16

2 years ago

1.0.0-alpha.18

2 years ago

1.0.0-alpha.17

2 years ago

1.0.0-alpha.9

2 years ago

1.0.0-alpha.8

2 years ago

1.0.0-alpha.7

2 years ago

1.0.0-alpha.6

2 years ago

1.0.0-alpha.10

2 years ago

1.0.0-alpha.15

2 years ago

1.0.0-alpha.12

2 years ago

1.0.0-alpha.11

2 years ago

1.0.0-alpha.14

2 years ago

1.0.0-alpha.13

2 years ago

1.0.0-alpha.5

2 years ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

1.0.0-alpha.0

2 years ago