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
Parameter | Type | Description |
---|---|---|
normalizedPath | string | path to file/folder, use normalizePath() to normalize beforehand. |
fn | (data: string) โ string | a callback function which returns the new content of the file synchronously. |
options | DataWriteOptions | (Optional) write options. |
Returns:
Promise<string>
string - the text value of the file that was written.