JSPM

@nodejs-loaders/jsonc

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q29127F
  • License ISC

Extend node to support JSONC via customization hooks.

Package Exports

  • @nodejs-loaders/jsonc
  • @nodejs-loaders/jsonc/jsonc.mjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@nodejs-loaders/jsonc) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Nodejs Loaders: jsonc

@node.js loaders logo

npm version unpacked size

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