Writing and history
Live writing and atomic publishing
The .jsw file is append-only: one process can read while another writes, without seeing half a block. In the SDKs, the file only appears, complete, on fechar().
· jsonW 1.3.11
The problem
A reader that opens a file while another program writes it can get a cut line. And a program that crashes mid-write can leave a half-written file in place of the good one.
How jsonW solves it
Each .jsw block stands on its own, with a marker, CRC32C and hash. That is why the format allows streaming reads while another process writes, like a tail -f that never sees half a block. When writing through the SDKs, the file is only published on fechar(); on error, call abandonar() and the destination stays as it was.
const { Escritor } = require("@wortictecnologia/jsonw");
const e = new Escritor("eventos.jsw", "id:i64,tipo:dic,quando:tempo");
e.gravar({ id: 1, tipo: "entrada", quando: "2026-11-13T09:00:00Z" });
e.fechar();
Writing with the Node SDK (npm @wortictecnologia/jsonw). The file eventos.jsw only comes into existence, complete, on fechar().
Where it is
Atomic publishing is in all 10 SDKs. Reading during writing exists in the core, but in version 1.3.11 it has no command in wjsw and no function in the public ABI.