It would be awesome to support
package.json is typically edited by humans, and JSON5 was designed as a small superset to JSON exactly for that purpose. It allows comments, unquoted keys and trailing comments.
I believe this could be done in a 100% backward compatible way. We simply need that
npm publish automatically translate
package.json. Thus, anyone downloading any npm library would still get a
package.json as before (and no
npm install could look for a
package.json file, and if none is found look for a
package.json5. Developers could thus work locally with the
package.json5 file instead (assuming they had a version of
npm that supports it). Meanwhile, end users wouldn’t see that
package.json5 and could still use an old version of
I would be glad to provide a PR for this if the general idea is accepted.
Note: Babel already supports JSON5 for its