appendFileSync
appendFileSync(path, data): void
Synchronously appends data to the end of the file at path, creating the
file (and any parent directories) if it does not exist.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | PathLike | The path of the file to append to. |
data | string | BufferSource | The data to append (string is UTF-8 encoded). |
Returns
void
Example
Switch.appendFileSync('sdmc:/switch/awesome-app/log.txt', `${line}\n`);