Learn R Programming

automerge (version 0.3.0)

am_save: 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)

Value

A raw vector containing the serialized document

Arguments

doc

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

Examples

Run this code
doc <- am_create()
bytes <- am_save(doc)
bytes

# Save to file
file <- tempfile()
writeBin(am_save(doc), file)

unlink(file)
am_close(doc)

Run the code above in your browser using DataLab