Hasty Briefsbeta

Bilingual

Show HN: JSON to Md(gfm)

12 hours ago
  • Converts JSON to human-readable GitHub Flavored Markdown with deterministic output.
  • Runs in browser, Node, Go, and command line; TypeScript and Go implementations produce byte-identical output.
  • Output is a one-way projection using canonical formatting: # Results heading, LF endings, no trailing spaces.
  • Reduces token cost for LLMs compared to raw JSON by removing structural punctuation.
  • npm package @rajnandan1/json-to-md with ESM, CJS, TypeScript declarations, and no runtime dependencies.
  • Supports CDN usage via jsDelivr, unpkg, esm.sh, and an IIFE build for classic scripts.
  • Go package provides identical API with ConvertText and ConvertValue, plus CLI via brew or go install.
  • Two entry points: convertJsonText for untrusted JSON (preserves numeric spelling) and convertJsonValue for parsed data.
  • Structured error handling with codes, JSON Pointers, and UTF-16 locations.
  • Renders objects as headings, arrays of objects as tables, and nested containers as detail sections with links.
  • No input-size limits; iterative parsing avoids stack overflow.
  • Benchmarked on a 7.5 MiB OpenAPI spec: ~128 ms (Go) and ~211 ms (TypeScript).
  • MIT licensed.