JSONC related APIs
namespace
JSONC
namespace JSONC
- input: string): unknown;
Parse a JSONC (JSON with Comments) string into a JavaScript value.
Supports both single-line (
//) and block comments (/* ... */), as well as trailing commas in objects and arrays.@param inputThe JSONC string to parse
@returnsA JavaScript value
const result = Bun.JSONC.parse(`{ // This is a comment "name": "my-app", "version": "1.0.0", // trailing comma is allowed }`);