Skip to content

platform/node/atomic-file

writeFileAtomic(path, data): Promise<void>

Defined in: app/src/platform/node/atomic-file.ts:12

Writes a file so that readers see either the old or the new content, never a partial file: the data goes to a temporary file, is flushed to disk and then renamed over the target.

string

Target file.

string | Uint8Array<ArrayBufferLike>

New content.

Promise<void>


writeFileAtomicSync(path, data): void

Defined in: app/src/platform/node/atomic-file.ts:30

Synchronous variant of writeFileAtomic, for shutdown and startup paths.

string

Target file.

string | Uint8Array<ArrayBufferLike>

New content.

void