Package Exports
- fast-json-parse
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fast-json-parse) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
fast-json-parse
It is equivalent to json-parse-safe,
but it set both the err and value property to null.
Install
npm i fast-json-parse --saveUsage
You can use it as a function or via a contructor, as you prefer.
function
'use strict'
var parse = require('fast-json-parse')
var fs = require('fs')
var result = parse(fs.readFileSync('./package.json'))
if (result.err) {
// unable to parse json
console.log(err.message)
} else {
console.log('json parsed successfully')
}constructor
'use strict'
var Parse = require('fast-json-parse')
var fs = require('fs')
var result = new Parse(fs.readFileSync('./package.json'))
if (result.err) {
// unable to parse json
console.log(err.message)
} else {
console.log('json parsed successfully')
}Acknowledgements
fast-json-parse is sponsored by nearForm.
License
MIT