New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

jsonc-effect

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonc-effect

Pure Effect-TS implementation of a JSONC (JSON with Comments) parser

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
685
18.1%
Maintainers
1
Weekly downloads
 
Created
Source

jsonc-effect

npm version License: MIT TypeScript

Pure Effect JSONC (JSON with Comments) parser with no external parser dependencies. Scanner, parser, AST, and formatting are all implemented natively.

Features

  • Effect-native -- typed errors, Schema integration, and composable pipelines
  • Zero parser dependencies -- effect is the sole runtime dependency
  • Schema integration -- parse JSONC strings directly into validated types
  • Full toolchain -- scanner, parser, AST navigation, visitor stream, formatting, and modification
  • Equality comparisons -- compare JSONC documents semantically, ignoring comments, formatting, and key ordering
  • Safe by default -- returns unknown (not any) and Option (not undefined)

Installation

npm install jsonc-effect effect

Quick Start

import { parse } from "jsonc-effect"
import { Effect } from "effect"

const result = Effect.runSync(
  parse('{ "key": 42, /* comment */ }')
)
// => { key: 42 }

Semantically compare two JSONC documents:

import { equals } from "jsonc-effect"
import { Effect } from "effect"

// Semantically equal despite different formatting, comments, and key order
const same = Effect.runSync(
  equals(
    '{ "foo": 1, "bar": 2 }',
    '{ "bar": 2, /* comment */ "foo": 1 }'
  )
)
// => true

FAQ

Why does this module exist?

If you just need to parse JSONC into a JavaScript object, use jsonc-parser or Bun's native JSONC support. They are faster and have no dependencies.

This library is for Effect-based programs that need deeper introspection and editing of JSONC documents: typed parse errors you can catchTag, Schema pipelines that validate JSONC strings into domain types, AST navigation, document modification and SAX-style visitor streams that are composable in Effect pipelines.

Documentation

For API reference, advanced usage, and examples, see docs.

License

MIT

Keywords

jsonc

FAQs

Package last updated on 25 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts