@nodejs-loaders/jsonc
v1.2.0
Published
Extend node to support JSONC via customization hooks.
Readme
Nodejs Loaders: jsonc
Usage
$ npm i -D @nodejs-loaders/jsonc$ node --import @nodejs-loaders/jsonc main.jsSee README.md in the repository's root for more details.
Environments: dev, test
Compatible APIs:
To import a JSONC file in node, it must have a .jsonc file extension and an import attribute in the import statement (for consistency with Node.js's support for json imports):
import data from './data.jsonc' with { type: 'jsonc' };
// OR
const data = await import('./data.jsonc', { with { type: 'jsonc' } });{
// JSONC file
"key": "value"
/* comment */
}.jsonc
