@wirelineio/automerge-worker

v0.1.12
Automerge doc on a worker

automerge-worker

Usage

const { createAutomergeWorker } = require('@wirelineio/automerge-worker');

// Create an instance of worker.
const worker = createAutomergeWorker();

// Use worker API.
const { changes } = await createDocument(feedKey, itemId);
const content = await getDocumentContent(itemId);

Usage with Webpack

Web

  • Use the webpack plugin CopyWebpackPlugin to copy the automerge.worker.js from dist/umd:
{
  plugins: [
    new CopyWebpackPlugin: ['../../node_modules/@wirelineio/automerge-worker/dist/umd/automerge.worker.js']
  ]
}

Node

  • Use the webpack plugin CopyWebpackPlugin to copy the automerge.worker.js from dist/cjs:
{
  plugins: [
    new CopyWebpackPlugin: ['../../node_modules/@wirelineio/automerge-worker/dist/cjs/automerge.worker.js']
  ]
}

Config AUTOMERGE_WORKER_PATH

The env variable AUTOMERGE_WORKER_PATH can be set to specify the path to the worker file copied in the previous step.

npm i @wirelineio/automerge-worker

Metadata

  • ISC
  • Whatever
  • Unknown
  • released 4/11/2019

Downloads