read-json5-file
TypeScript icon, indicating that this package has built-in type declarations

0.0.0 • Public • Published

read-json5-file

Read and parse a JSON5 file

npm version

Strips UTF-8 BOM and uses graceful-fs.

Installation

<npm|yarn|pnpm> add read-json5-file

Usage

'use strict'
const loadJson5File = require('read-json5-file')
const path = require('path')
 
const fixture = path.join(__dirname, 'countries.json5')
const countries = loadJson5File.sync(fixture)
console.log(countries)
//> [ 'Ukraine', 'Hungary', 'Slovakia' ]

API

loadJson5File(filepath)

Returns a promise for the parsed JSON5.

loadJson5File.sync(filepath)

Returns the parsed JSON5.

Related

License

MIT © Zoltan Kochan

Package Sidebar

Install

npm i read-json5-file

Weekly Downloads

26

Version

0.0.0

License

MIT

Unpacked Size

3.92 kB

Total Files

5

Last publish

Collaborators

  • zkochan