DataAdapter โ€บ process

DataAdapter.process() method

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

Signature:

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

Parameters

ParameterTypeDescription
normalizedPathstringpath to file/folder, use normalizePath() to normalize beforehand.
fn(data: string) โ‡’ stringa callback function which returns the new content of the file synchronously.
optionsDataWriteOptions(Optional) write options.

Returns:

Promise<string>

string - the text value of the file that was written.