---
title: "@std/jsonc"
description: "Parsing and serializing of JSONC files"
jsr: jsr:@std/jsonc
pkg: jsonc
version: 1.0.2
generated: true
stability: stable
---
<!-- Autogenerated from JSR docs. Do not edit directly. -->

## Overview

<p>Provides tools for working with
<a href="https://code.visualstudio.com/docs/languages/json#_json-with-comments" rel="nofollow">JSONC</a>
(JSON with comments).</p>
<p>Currently, this module only provides a means of parsing JSONC. JSONC
serialization is not yet supported.</p>

```js
import { parse } from "@std/jsonc";
import { assertEquals } from "@std/assert";

assertEquals(parse('{"foo": "bar", } // comment'), { foo: "bar" });
assertEquals(parse('{"foo": "bar", } /* comment *\/'), { foo: "bar" });
```

### Add to your project

```sh
deno add jsr:@std/jsonc
```

<a href="https://jsr.io/@std/jsonc/doc" class="docs-cta jsr-cta">See all symbols in @std/jsonc on
<svg class="inline ml-1" viewBox="0 0 13 7" aria-hidden="true" height="20"><path d="M0,2h2v-2h7v1h4v4h-2v2h-7v-1h-4" fill="#083344"></path><g fill="#f7df1e"><path d="M1,3h1v1h1v-3h1v4h-3"></path><path d="M5,1h3v1h-2v1h2v3h-3v-1h2v-1h-2"></path><path d="M9,2h3v2h-1v-1h-1v3h-1"></path></g></svg></a>

<!-- custom:start -->
<!-- Add persistent custom content below. This section is preserved across generations. -->

<!-- custom:end -->
