nx.js
NamespacesSwitchFunctions

readFile

readFile(path): Promise<null | ArrayBuffer>

Returns a Promise which resolves to an ArrayBuffer containing the contents of the file at path.

Parameters

ParameterType
pathPathLike

Returns

Promise<null | ArrayBuffer>

Example

const buffer = await Switch.readFile('sdmc:/switch/awesome-app/state.json');
const gameState = JSON.parse(new TextDecoder().decode(buffer));

On this page