1.0.0 • Published 7 years ago

load-json5-file v1.0.0

Weekly downloads
60
License
MIT
Repository
github
Last release
7 years ago

load-json5-file

Read and parse a JSON5 file

npm version Build Status

Strips UTF-8 BOM and uses graceful-fs.

Installation

npm i -S load-json5-file

Usage

'use strict'
const loadJson5File = require('load-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