Provides tools for working with JSONC (JSON with comments).
Currently, this module only provides a means of parsing JSONC. JSONC serialization is not yet supported.
import { parse } from "@std/jsonc";import { assertEquals } from "@std/assert";assertEquals(parse('{"foo": "bar", } // comment'), { foo: "bar" });assertEquals(parse('{"foo": "bar", } /* comment */'), { foo: "bar" }); Copy
import { parse } from "@std/jsonc";import { assertEquals } from "@std/assert";assertEquals(parse('{"foo": "bar", } // comment'), { foo: "bar" });assertEquals(parse('{"foo": "bar", } /* comment */'), { foo: "bar" });
Provides tools for working with JSONC (JSON with comments).
Currently, this module only provides a means of parsing JSONC. JSONC serialization is not yet supported.