Skip to main content
@obversa/memory-simple keeps memory files in one process, with the same commands, limits and error codes as every other adapter. Use it in tests and in runs that don’t need memory to outlive the process; for memory that survives a restart, use Git Memory.

Install

Included in @obversa/obversa.

Requirements

Nothing beyond Node.js.

Quickstart

Create the adapter with a scope, write a note and read it back:
examples/memory-simple.ts (excerpt)
The adapter supports all six commands of the memory port: view, create, str_replace, insert, delete and rename. Pass it to run(job, { memory }) and every job reads it as ctx.memory. Run the whole file with npx tsx memory-simple.ts:
Output

Options

Errors

  • The port’s error codes, listed on Memory port.
  • A write past a limit removes the earliest-written files until it fits, never the file being written.

API

  • createSimpleMemory(options): a Memory in one process. Quickstart.
  • SimpleMemoryOptions: its options.

Next steps