am_save: Save an Automerge document to binary format

View source: R/document.R

am_saveR Documentation

Save an Automerge document to binary format

Description

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
file <- tempfile()
writeBin(am_save(doc), file)

unlink(file)
am_close(doc)


automerge documentation built on Feb. 5, 2026, 5:08 p.m.