# @automerge/automerge

> Javascript implementation of automerge, backed by @automerge/automerge-wasm

Latest version **3.5.0** (published 2026-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @automerge/automerge
pnpm add @automerge/automerge
yarn add @automerge/automerge
bun add @automerge/automerge
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; large bundle.

## Facts

| | |
|---|---|
| Version | 3.5.0 |
| Published | 2026-09-16 |
| First published | 2022-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6656 |
| Maintainers | pvh, martinkl, orionhenry, memorythought, expede, jtfmumm-dev |

## Links

- npm: https://www.npmjs.com/package/@automerge/automerge
- Repository: https://github.com/automerge/automerge
- Homepage: https://github.com/automerge/automerge/tree/main/javascript
- Issues: https://github.com/automerge/automerge/issues
- npm.io page: https://npm.io/package/@automerge/automerge

## Recent versions

- 3.5.0 (latest) — 2026-09-16
- 3.4.0-rev-frag-hex.3 (next) — 2026-07-02
- 3.0.0-alpha.4 (alpha) — 2025-05-05
- 3.0.0-preview.13 (preview) — 2025-04-07
- 3.4.1 — 2026-08-12
- 3.4.0 — 2026-07-31
- 3.3.2 — 2026-07-14
- 3.3.1 — 2026-07-13
- 3.3.0 — 2026-07-12
- 3.4.0-rev-frag-hex.2 — 2026-07-02
- 3.3.0-fragments.2 — 2026-06-22
- 3.4.0-rev-frag-hex.1 — 2026-06-19
- 3.3.0-fragments.1 — 2026-05-21
- 3.3.0-fragments.0 — 2026-05-20
- 3.2.6 — 2026-04-22
- … 123 more at https://npm.io/package/@automerge/automerge/versions

## README

## Automerge

Automerge is a library of data structures for building collaborative
applications, this package is the javascript implementation.

Detailed documentation is available at [automerge.org](http://automerge.org/)
but see the following for a short getting started guid.

## Quickstart

First, install the library.

```
npm install @automerge/automerge
```

If you're writing a `node` application, you can skip straight to [Make some
data](#make-some-data). If you're in a browser you need a bundler

### Bundler setup

`@automerge/automerge` is a wrapper around a core library which is written in
rust, compiled to WebAssembly and distributed as a separate package called
`@automerge/automerge-wasm`. Browsers don't currently support WebAssembly
modules taking part in ESM module imports, so you must use a bundler to import
`@automerge/automerge` in the browser. There are a lot of bundlers out there, we
have examples for common bundlers in the `examples` folder. Here is a short
example using Webpack 5.

Assuming a standard setup of a new webpack project, you'll need to enable the
`asyncWebAssembly` experiment. In a typical webpack project that means adding
something like this to `webpack.config.js`

```javascript
module.exports = {
  ...
  experiments: { asyncWebAssembly: true },
  performance: {       // we dont want the wasm blob to generate warnings
     hints: false,
     maxEntrypointSize: 512000,
     maxAssetSize: 512000
  }
};
```

### Make some data

Automerge allows to separate threads of execution to make changes to some data
and always be able to merge their changes later.

```javascript
import * as automerge from "@automerge/automerge"
import * as assert from "assert"

let doc1 = automerge.from({
  tasks: [
    { description: "feed fish", done: false },
    { description: "water plants", done: false },
  ],
})

// Create a new thread of execution
let doc2 = automerge.clone(doc1)

// Now we concurrently make changes to doc1 and doc2

// Complete a task in doc2
doc2 = automerge.change(doc2, d => {
  d.tasks[0].done = true
})

// Add a task in doc1
doc1 = automerge.change(doc1, d => {
  d.tasks.push({
    description: "water fish",
    done: false,
  })
})

// Merge changes from both docs
doc1 = automerge.merge(doc1, doc2)
doc2 = automerge.merge(doc2, doc1)

// Both docs are merged and identical
assert.deepEqual(doc1, {
  tasks: [
    { description: "feed fish", done: true },
    { description: "water plants", done: false },
    { description: "water fish", done: false },
  ],
})

assert.deepEqual(doc2, {
  tasks: [
    { description: "feed fish", done: true },
    { description: "water plants", done: false },
    { description: "water fish", done: false },
  ],
})
```

## Development

See [HACKING.md](../javascript/HACKING.md)

## Meta

Copyright 2017–present, the Automerge contributors. Released under the terms of the
MIT license (see `LICENSE`).

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