Environments: dev, test
Compatible APIs: module.register
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 */
}
Supported file extensions
.jsonc