@wirelineio/automerge-worker

0.1.12 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @wirelineio/automerge-worker

Weekly Downloads

0

Version

0.1.12

License

ISC

Unpacked Size

590 kB

Total Files

15

Last publish

Collaborators

  • dboreham
  • telackey
  • egorgripasov
  • richburdon
  • ashwinp