Skip to content

Serializes an Automerge document to the standard binary format, which can be saved to disk or transmitted over a network. The binary format is compatible across all Automerge implementations (JavaScript, Rust, etc.).

Usage

am_save(doc)

Arguments

doc

An Automerge document (created with am_create() or am_load())

Value

A raw vector containing the serialized document

Examples

doc <- am_create()
bytes <- am_save(doc)

# Save to file
if (FALSE) { # \dontrun{
writeBin(am_save(doc), "document.automerge")
} # }