Closed bluelovers closed 4 years ago
Hmm, this is an interesting concept worth considering... I like how it'd allow anyone to inject anything they want... however, maybe it should be passed via the method itself to prevent any bugs due to global overwriting.
Thoughts @RyanZim?
Yes, should most certainly be passed into the method. I hate global overwriting.
However, that's gonna be painful; I'm honestly thinking perhaps we should transform this to a class-based pattern. The existing API would stay the same, but you could also do:
const jsonfile = new (require('jsonfile').JSONFile)({
JSON: require('json5'),
spaces: 4
})
jsonfile.writeFileSync('file', data)
Closing since this is a ghost town since 2017.
allow change JSON like module (ex: JSON5)