You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've improved several APIs to handle JSONC out of the box.
package.json files may have comments and trailing commas
console.log({ ... }) prints trailing commas
These are good user experiences, but dynamically reading data formatted this way is currently difficult (e.g. using Glob to walk a directory and read all package.json files). JSON.parse does not support it in order to maintain spec compliance, so users need to install a third-party library.
What is the feature you are proposing to solve the problem?
Add an API to parse JSONC natively.
I'm currently thinking something like Bun.json.parse(obj), but would love input on API design.
Ideally the API would
look and act in a familiar way to JSON.parse, but with non spec-compliant niceties for better DX
Be namespaced so we can add more stuff in the future
The text was updated successfully, but these errors were encountered:
What is the problem this feature would solve?
We've improved several APIs to handle JSONC out of the box.
package.json
files may have comments and trailing commasconsole.log({ ... })
prints trailing commasThese are good user experiences, but dynamically reading data formatted this way is currently difficult (e.g. using
Glob
to walk a directory and read allpackage.json
files).JSON.parse
does not support it in order to maintain spec compliance, so users need to install a third-party library.What is the feature you are proposing to solve the problem?
Add an API to parse JSONC natively.
I'm currently thinking something like
Bun.json.parse(obj)
, but would love input on API design.Ideally the API would
JSON.parse
, but with non spec-compliant niceties for better DXThe text was updated successfully, but these errors were encountered: