nx.js
NamespacesSwitchFunctions

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

ParameterTypeDescription
pathPathLikeThe path of the file to append to.
datastring | BufferSourceThe data to append (string is UTF-8 encoded).

Returns

void

Example

Switch.appendFileSync('sdmc:/switch/awesome-app/log.txt', `${line}\n`);

On this page