npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jsononlineparse/core

v0.1.0

Published

Fast, privacy-first JSON validation, formatting, repair and input detection utilities.

Readme

@jsononlineparse/core

Fast, lightweight, privacy-first developer utility engine for JSON validation, formatting, minification, repair, code conversion, and data classification.

Used internally by jsononlineparse.com.

Features

  • Zero Dependencies: Pure TypeScript algorithm loop built for browsers and Node.js.
  • Tree-Shakable: ESM modules design allowing you to import only what you need.
  • Privacy First: 100% offline data processing. Payload strings never leave your machine.
  • Granular Diagnostics: Normalizes V8 parsing errors into structured metadata with lines, columns, and explanations.

Installation

npm install @jsononlineparse/core

Quick Start

import { validateJSON, formatJSON, repairJSON, detectInput } from "@jsononlineparse/core"

// 1. Syntax Validation
const validation = validateJSON('{"name":"Salil"}')
if (validation.valid) {
  console.log("Valid JSON value:", validation.value)
} else {
  console.error("Syntax code:", validation.error.code) // e.g. "TRAILING_COMMA"
}

// 2. Intelligent Format
const format = formatJSON('{"id":123}', { indent: 2 })
if (format.success) {
  console.log(format.value)
}

// 3. Smart Repair (unquoted keys, single quotes, trailing commas)
const repair = repairJSON("{name: 'Salil', age: 30,}")
if (repair.success) {
  console.log("Repaired:", repair.value) // {"name":"Salil","age":30}
  console.log("Applied Repairs:", repair.repairs) 
}

API Reference

validateJSON(input: string): ValidationResult

Returns { valid: true, value: any } or { valid: false, error: JOPError }.

formatJSON(input: string, options?: FormatOptions): Result<string>

Reformats JSON text. Options let you configure space indentation (number | 'tab').

minifyJSON(input: string): Result<string>

Strips all whitespaces, newlines, and indentation from valid JSON documents.

repairJSON(input: string): RepairResult

Resolves common JSON mistakes and logs list of actions taken.

diagnoseJSONError(input: string): DiagnoseResult

Analyzes syntactical exceptions with lines, columns, explanations, and instructions.

detectInput(input: string): DetectionResult

Analyzes character blocks to identify if content is JSON, JWT, API errors, or plain logs.

jsonToTypeScript(input: string, rootName?: string): Result<string>

Translates JSON structures into structured TypeScript interfaces and type declarations.

Privacy & Security

This library contains no network logic, telemetry scripts, or external dependencies. All data is processed synchronously on the local thread.

License

MIT