nx.js
NamespacesSwitchFunctions

readFileSync

readFileSync(path): null | ArrayBuffer

Synchronously returns an ArrayBuffer containing the contents of the file at path.

Parameters

ParameterType
pathPathLike

Returns

null | ArrayBuffer

Example

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

On this page