JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q33789F
  • License AGPL-3.0-or-later

base class for replication using multifeed

Package Exports

  • @coboxcoop/replicator
  • @coboxcoop/replicator/index.js
  • @coboxcoop/replicator/lib/level
  • @coboxcoop/replicator/lib/level.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@coboxcoop/replicator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

replicator

standard-readme compliant

Table of Contents

About

CoBox is an encrypted p2p file system and distributed back-up tool. README provides a map of the project.

replicator provides a base class for replication. Initialises keys with validations, sets up storage paths, initialises feeds and enables replication.

These are all common functions for any space class, so we can inherit from the replicator class to extend functionality, such as for space, or admin space, which initialize additional but different logs.

Install

npm i -g @coboxcoop/replicator

Usage

const Replicator = require('@coboxcoop/replicator')

// you can either create a replicator instance (see tests), or inherit to add further functionality, e.g.

class MyReplicatorClass extends Replicator {
  constructor (storage, address, identity, opts) {
    super(storage, address, identity, opts)

    // initFeeds must be called to initialize multifeed and storage correctly
    this._initFeeds({})
  }

  ready () {
    this.open(() => {
      // make your replicator ready, call any prep async functions
    })
  }
}

API

See swagger documentation... (we won't have this for a while).

Contributing

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

AGPL-3.0-or-later