Skip to main content

@std/jsonc@1.0.1
Built and signed on GitHub Actions

Parsing and serializing of JSONC files

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
5 months ago (1.0.1)

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" });
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add jsr:@std/jsonc

Import symbol

import * as jsonc from "@std/jsonc";

---- OR ----

Import directly with a jsr specifier

import * as jsonc from "jsr:@std/jsonc";

Add Package

npx jsr add @std/jsonc

Import symbol

import * as jsonc from "@std/jsonc";

Add Package

yarn dlx jsr add @std/jsonc

Import symbol

import * as jsonc from "@std/jsonc";

Add Package

pnpm dlx jsr add @std/jsonc

Import symbol

import * as jsonc from "@std/jsonc";

Add Package

bunx jsr add @std/jsonc

Import symbol

import * as jsonc from "@std/jsonc";