node
node copied to clipboard
module: allow JSONC imports
This PR introduces the ability to import JSONC
typed JSON files via the { type: 'jsonc' }
import attribute.
Review requested:
- [ ] @nodejs/loaders
When I get a change, Ill adjust the small prettification differences
Do any other runtimes support JSONC or plan to?
I know Deno supports it with its builtin standard library (https://deno.land/[email protected]/jsonc), but I'm not sure about importing
I'll need to check the other runtimes, and more about Denos imports
- That is better handled by userland hooks.
If https://github.com/nodejs/node/pull/49704 ever gets revived, that could also facilitate this so users don't have to manually sort out something almost everyone wants.