Skip to content

DataAdapter.process method

DataAdapter › process

Official

Atomically read, modify, and save the contents of a plaintext file.

Signature:

process(normalizedPath: string, fn: (data: string) => string, options?: DataWriteOptions | undefined): Promise<string>

Parameters:

ParameterTypeDescription
normalizedPathstringpath to file/folder, use {@link normalizePath} to normalize beforehand.
fn(data: string) => stringa callback function which returns the new content of the file synchronously.
options?DataWriteOptions | undefinedwrite options.

Returns: Promise<string>string - the text value of the file that was written.