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

nx-json-parser

v1.3.0

Published

Transform strings to JSON based on Markdown structure using unified/remark

Readme

nx-json-parser

A robust Markdown-to-JSON transformer SDK built on top of unified, remark, and remark-gfm.

Designed for structured data extraction from LLM outputs and other Markdown-formatted strings.

Features

  • AST-Based Parsing: Uses remark for reliable, production-grade Markdown parsing (no regex hell).
  • Table Support: Automatically converts Markdown tables into arrays of JavaScript objects using remark-gfm.
  • List Support: Smartly handles lists, converting them to arrays.
  • Bullet-Style Sections: Includes a custom plugin to detect and transform bulleted "sections" (e.g., - Title: Content) into structured JSON keys.
  • CamelCase Normalization: Automatically transforms headings and table headers into camelCase keys.
  • Extensible: Built on the unified ecosystem, allowing for additional plugins (math, frontmatter, etc.).

Installation

npm install nx-json-parser

Usage

Basic Usage

import { markdownToJson } from 'nx-json-parser';

const md = `
# Summary
The product is a high-performance database.

## Key Features
- Scalable
- Secure
- Fast
`;

const result = markdownToJson(md);
/*
{
  summary: "The product is a high-performance database.",
  keyFeatures: ["Scalable", "Secure", "Fast"]
}
*/

Table Support

const md = `
### Database Performance
| Metric | Value | Status |
|--------|-------|--------|
| Latency| 5ms   | OK     |
| Throughput | 10k ops/s | High |
`;

const result = markdownToJson(md);
/*
{
  databasePerformance: [
    { metric: "Latency", value: "5ms", status: "OK" },
    { metric: "Throughput", value: "10k ops/s", status: "High" }
  ]
}
*/

Bullet-Style Sections

LLMs often output sections using bullet points. nx-json-parser detects this pattern and treats them as structured keys:

const md = `
- Short Answer
The sky appears blue due to Rayleigh scattering.

- Technical Detail
Short-wavelength light is scattered more strongly by atmospheric gases.
`;

const result = markdownToJson(md);
/*
{
  shortAnswer: "The sky appears blue due to Rayleigh scattering.",
  technicalDetail: "Short-wavelength light is scattered more strongly by atmospheric gases."
}
*/

API

markdownToJson(markdown: string): any

Converts a Markdown string to a JSON object.

JSONTransformer

The main class for transformation. You can provide a custom RemarkParser if needed.

import { JSONTransformer, RemarkParser } from 'nx-json-parser';

const transformer = new JSONTransformer({
  parser: new RemarkParser()
});
const result = transformer.transform(md);

License

ISC