Parse a JSONC (JSON with Comments) string into a JavaScript value.
Supports both single-line (http://) and block comments (/* ... */), as well as trailing commas in objects and arrays.
Search the reference...
/
function
Parse a JSONC (JSON with Comments) string into a JavaScript value.
Supports both single-line (http://) and block comments (/* ... */), as well as trailing commas in objects and arrays.
The JSONC string to parse
A JavaScript value
const result = Bun.JSONC.parse(`{
// This is a comment
"name": "my-app",
"version": "1.0.0", // trailing comma is allowed
}`);
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlogToolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →