Skip to main content
Home

@std/jsonc@1.0.2
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
7 months ago (1.0.2)

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

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

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

pnpm i jsr:@std/jsonc
or (using pnpm 10.8 or older)
pnpm dlx jsr add @std/jsonc

Import symbol

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

Add Package

yarn add jsr:@std/jsonc
or (using Yarn 4.8 or older)
yarn dlx jsr add @std/jsonc

Import symbol

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

Add Package

vlt install jsr:@std/jsonc

Import symbol

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

Add Package

npx 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";