package
A require hook to load JSON files with comments
npm install jsonc-registerGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 3 packages.
22.3 kB
Includes dependencies.
jsonc-registerjson-register hooks into Node's require function to load .json or .jsonc files that support comments.
const { register } = require('jsonc-register');
register();
const a = require('/path/to/my-file.json');
const b = require('/path/to/my-file.jsonc');