nx.js
NamespacesSwitchFunctions

readFileSync

readFileSync(path, opts?): null | ArrayBuffer

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

Parameters

ParameterType
pathPathLike
opts?ReadFileOptions

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