This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/json5/lib/register.js
2019-08-11 20:48:02 +02:00

13 lines
374 B
JavaScript

const fs = require('fs')
const JSON5 = require('./')
// eslint-disable-next-line node/no-deprecated-api
require.extensions['.json5'] = function (module, filename) {
const content = fs.readFileSync(filename, 'utf8')
try {
module.exports = JSON5.parse(content)
} catch (err) {
err.message = filename + ': ' + err.message
throw err
}
}