UNPKG

cosmiconfig

Version:

Find and load configuration from a package.json property, rc file, or CommonJS module

13 lines (10 loc) 252 B
'use strict'; var jph = require('json-parse-helpfulerror'); module.exports = function (json, filepath) { try { return jph.parse(json); } catch (err) { err.message = 'JSON Error in ' + filepath + ':\n' + err.message; throw err; } };