readFile
readFile(path, opts?): Promise<null | ArrayBuffer>
Returns a Promise which resolves to an ArrayBuffer containing
the contents of the file at path.
Parameters
| Parameter | Type |
|---|---|
path | PathLike |
opts? | ReadFileOptions |
Returns
Promise<null | ArrayBuffer>
Example
const buffer = await Switch.readFile('sdmc:/switch/awesome-app/state.json');
const gameState = JSON.parse(new TextDecoder().decode(buffer));