read-json5-file
Read and parse a JSON5 file
Strips UTF-8 BOM and uses graceful-fs
.
Installation
<npm|yarn|pnpm> add read-json5-file
Usage
'use strict'const loadJson5File = const path = const fixture = pathconst countries = loadJson5Fileconsole//> [ 'Ukraine', 'Hungary', 'Slovakia' ]
API
loadJson5File(filepath)
Returns a promise for the parsed JSON5.
loadJson5File.sync(filepath)
Returns the parsed JSON5.
Related
- write-json5-file - Stringify and write JSON5 to a file atomically
- load-json-file - Read and parse a JSON file
- json5 - JSON for the ES5 era