nx.js
NamespacesSwitchFunctions

writeFile

writeFile(path, data): Promise<void>

Returns a Promise which resolves after writing the contents of data to the file at path. Parent directories are created automatically.

Parameters

ParameterType
pathPathLike
datastring | BufferSource

Returns

Promise<void>

Example

const appStateJson = JSON.stringify(appState);
await Switch.writeFile('sdmc:/switch/awesome-app/state.json', appStateJson);

On this page