Read the content of a local .json file and return it as a JavaScript object.

await readJson(filepath)


const data = await readJson('./records.json');


Note that it will read the whole content before returning it, so might not be suitable for large files (in which case you might want to use streams instead).