automerge-classic README

The project's README from github.com/automerge/automerge-classic. As one markdown file: README.md.

Automerge logo

Deprecation Notice

Automerge now has a shiny new implementation at https://github.com/automerge/automerge. This repository is the original pure javascript implementation. All development effort has shifted to the new implementation which is written in Rust and so can easily be ported to other platforms.

Original Readme

💬 Join the Automerge Slack community

Build Status Browser Test Status

Automerge is a library of data structures for building collaborative applications in JavaScript.

Please see automerge.org for documentation.

For a set of extensible examples in TypeScript, see automerge-repo

Setup

If you're using npm, npm install automerge. If you're using yarn, yarn add automerge. Then you can import it with require('automerge') as in the example below (or import * as Automerge from 'automerge' if using ES2015 or TypeScript).

Otherwise, clone this repository, and then you can use the following commands:

Meta

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

automerge-classic (automerge/automerge-classic)

Searching Database…

这是什么?Automerge 是一个 JavaScript 库,实现了 CRDT(无冲突复制数据类型)。它是一种类似 JSON 的文档,多个用户可以在各自的副本上同时编辑,所有修改都会自动合并在一起,不会产生冲突。
我该如何把它加入我的项目?使用 `npm install automerge` 或 `yarn add automerge` 安装,然后使用 `require('automerge')`(如果使用 ES2015/TypeScript,则用 `import Automerge from 'automerge'`)。如果想改为从源码使用,请克隆仓库并运行 `yarn install`、`yarn test` 和 `yarn build`,即可在 `dist/automerge.js` 中得到可在浏览器中使用的打包文件。
它需要任何后端服务器或数据库才能运行吗?不需要。它是纯客户端的 JavaScript 库,不依赖服务器,只引入了几个小型辅助包(fast-sha256、pako、uuid),分别用于哈希计算和压缩。
今天我真的应该用这个版本吗?不应该。这个仓库已被弃用。它是最初的纯 JavaScript 实现,但所有开发工作都已转移到新的基于 Rust 的实现上,后者更便于移植到其他平台。
没有网络连接也能用吗?可以。它采用离线优先的设计:每个用户都可以在没有网络的情况下编辑自己的本地副本,副本重新同步后,修改会自动合并。
Automerge 与手动解决合并冲突有什么不同?作为 CRDT,它的数据结构经过设计,使并发编辑总能被确定性地自动合并。无需手动解决冲突,这与常规的合并工具不同。
我能在 Automerge 中使用 TypeScript 吗?可以。类型定义已内置(`@types/automerge`)。另外,automerge-repo 项目提供了更完整的 TypeScript 示例,基于较新的实现。
我应该去哪里看,而不是这个仓库?目前积极维护的后继项目是位于 automerge.org 的基于 Rust 的实现,以及 automerge-repo 项目。这个经典仓库仅保留供参考。
What are similar projects?yjs, gun, rxdb, electric, WatermelonDB, pouchdb, git-bug, epiq
Creator
automerge
Size
4 MB
Stars
14.7K
Updated
CommitMar 09
Age
9y
Commits · 90 Days