0.0.0 • Published 4 years ago

read-json5-file v0.0.0

Weekly downloads
10
License
MIT
Repository
github
Last release
4 years ago

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