# @coboxcoop/replicator

> base class for replication using multifeed

Latest version **1.0.6-alpha.1** (published 2022-04-07) · AGPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @coboxcoop/replicator
pnpm add @coboxcoop/replicator
yarn add @coboxcoop/replicator
bun add @coboxcoop/replicator
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6-alpha.1 |
| Published | 2022-04-07 |
| First published | 2020-07-29 |
| Weekly downloads | 0 |
| License | AGPL-3.0-or-later |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 23 |
| Unpacked size | 54 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | magma collective |
| Maintainers | kyphae, ameba23 |
| Keywords | cobox, replicator, multifeed, hypercore, hyperswarm |

## Links

- npm: https://www.npmjs.com/package/@coboxcoop/replicator
- Repository: https://gitlab.com/coboxcoop/replicator
- Homepage: https://cobox.cloud
- Issues: https://gitlab.com/coboxcoop/replicator/issues
- npm.io page: https://npm.io/package/@coboxcoop/replicator

## Dependencies (23)

- [pump](https://npm.io/package/pump.md) ^3.0.0
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [level](https://npm.io/package/level.md) ^6.0.0
- [assert](https://npm.io/package/assert.md) ^2.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^3.0.2
- [through2](https://npm.io/package/through2.md) ^3.0.1
- [corestore](https://npm.io/package/corestore.md) ^5.6.0
- [lodash.pick](https://npm.io/package/lodash.pick.md) ^4.4.0
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.2
- [nanoresource](https://npm.io/package/nanoresource.md) ^1.3.0
- [run-parallel](https://npm.io/package/run-parallel.md) ^1.1.9
- [call-me-maybe](https://npm.io/package/call-me-maybe.md) ^1.0.1
- [@coboxcoop/crypto](https://npm.io/package/@coboxcoop/crypto.md) ^1.0.2-alpha.1
- [@coboxcoop/logger](https://npm.io/package/@coboxcoop/logger.md) ^1.0.1-alpha.1
- [level-live-stream](https://npm.io/package/level-live-stream.md) ^1.4.13
- [@coboxcoop/schemas](https://npm.io/package/@coboxcoop/schemas.md) 1.0.0-alpha.1
- [random-access-file](https://npm.io/package/random-access-file.md) ^2.1.3
- [@coboxcoop/constants](https://npm.io/package/@coboxcoop/constants.md) ^1.0.1-alpha.1
- [@coboxcoop/multifeed](https://npm.io/package/@coboxcoop/multifeed.md) ^0.0.2
- [@coboxcoop/networker](https://npm.io/package/@coboxcoop/networker.md) ^1.0.0-alpha.1
- [hypercore-default-storage](https://npm.io/package/hypercore-default-storage.md) ^1.0.0
- [protocol-buffers-encodings](https://npm.io/package/protocol-buffers-encodings.md) ^1.1.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.0.6-alpha.1 (latest) — 2022-04-07
- 1.0.5-alpha.1 — 2021-06-11
- 1.0.4-alpha.1 — 2020-07-29
- 1.0.3-alpha.1 — 2020-07-29
- 1.0.2-alpha.1 — 2020-07-29
- 1.0.1-alpha.1 — 2020-07-29
- 1.0.0-alpha.1 — 2020-07-29

## README

# replicator

<div align="center">
  <img src="https://cobox.cloud/src/svg/logo.svg">
</div>

[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

## Table of Contents

  - [About](#about)
  - [Install](#install)
  - [Usage](#usage)
  - [API](#api)
  - [Contributing](#contributing)
  - [License](#license)

## About
**CoBox** is an encrypted p2p file system and distributed back-up tool. [README](https://gitlab.com/coboxcoop/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

```js
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](https://github.com/RichardLitt/standard-readme) specification.

# License

[`AGPL-3.0-or-later`](./LICENSE)

---
_Source: https://npm.io/package/@coboxcoop/replicator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
