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

@mummareddy_mohanreddy/jsone-core

v0.4.1

Published

jsone core library — JSON parsing, inference, and table generation

Readme

@mummareddy_mohanreddy/jsone-core

Universal JSON table inference and generation engine.

Convert ANY JSON (objects, arrays, primitives) into structured tables automatically. Zero dependencies, fully typed TypeScript.

Features

  • 🎯 Universal JSON Support — Objects, arrays, primitives, nested structures — all become valid tables
  • Zero Dependencies — Ultra-lightweight (9.1 kB), no external packages
  • 📊 Automatic Inference — Detects table structures and generates columns without configuration
  • 🔍 Smart Type Detection — Automatically identifies dates, numbers, booleans, and strings
  • 🪶 Fully Typed — Complete TypeScript support with full type definitions included
  • 📈 Nested Object Flattening — Converts nested objects to dot-notation columns
  • 🏆 Quality-Based Ranking — Multiple tables? Ranks by row count and column quality

Installation

npm install @mummareddy_mohanreddy/jsone-core

Quick Start

import { tableFromJsone } from "@mummareddy_mohanreddy/jsone-core";

// Single object
const json1 = { name: "Alice", age: 30, joined: "2024-01-15" };
const table1 = tableFromJsone(json1);
// Result: 1 row, 3 columns (name, age, joined)

// Array of objects
const json2 = [
  { id: 1, name: "Alice", role: "Admin" },
  { id: 2, name: "Bob", role: "User" }
];
const table2 = tableFromJsone(json2);
// Result: 2 rows, 3 columns

// Array of primitives
const json3 = ["apple", "banana", "cherry"];
const table3 = tableFromJsone(json3);
// Result: 3 rows, 2 columns (#index, value)

// Nested objects
const json4 = {
  users: [
    { name: "Alice", profile: { city: "NYC", zip: "10001" } },
    { name: "Bob", profile: { city: "LA", zip: "90001" } }
  ]
};
const table4 = tableFromJsone(json4);
// Result: 2 rows with flattened columns (name, profile.city, profile.zip)

API Reference

tableFromJsone(data: any, viewId?: string): TableResult

Converts any JSON structure into a table representation.

Parameters:

  • data — Any JSON value (object, array, primitive, nested structure)
  • viewId — Optional string for table identification

Returns: TableResult object containing:

  • rows: any[][] — 2D array of cell values
  • columns: Column[] — Column definitions with names and inferred types
  • messages: string[] — Any warnings or metadata messages

Example:

const result = tableFromJsone(jsonData);
console.log(result.rows);      // [[cell1, cell2, ...], ...]
console.log(result.columns);   // [{ name: "col1", type: "string" }, ...]

inferColumns(rows: any[][], maxSamples?: number): Column[]

Detects column types from row data using statistical analysis.

Returns: Array of Column objects with inferred types.

flattenRow(row: any, prefix?: string): Record<string, any>

Recursively flattens nested objects into dot-notation keys.

Example:

flattenRow({ user: { name: "Alice", profile: { city: "NYC" } } });
// Returns: { "user.name": "Alice", "user.profile.city": "NYC" }

Type Detection

The library automatically detects:

  • Dates — ISO 8601 format (80% heuristic threshold)
  • Numbers — Integers and floats
  • Booleanstrue/false values
  • Strings — Default fallback
  • Null/Undefined — Preserved as-is

Optional Metadata

Wrap JSON in $meta to provide explicit table hints:

const json = {
  $meta: {
    title: "Sales Report",
    description: "Q1 2024 sales data"
  },
  data: [
    { product: "Widget", revenue: 10000 },
    { product: "Gadget", revenue: 15000 }
  ]
};

const table = tableFromJsone(json);
// Uses data array as table source, applies metadata hints

TypeScript Support

Full TypeScript support with exported types:

import type { 
  TableResult, 
  Column, 
  ColumnType 
} from "@mummareddy_mohanreddy/jsone-core";

const result: TableResult = tableFromJsone(data);

Performance

  • Parsing: O(n) time complexity where n = JSON depth
  • Inference: O(r × c) where r = rows, c = columns
  • Memory: No external dependencies, minimal overhead

Use Cases

  • 📄 Convert JSON API responses to viewable tables
  • 📊 Transform database exports into structured data
  • 🔍 Explore complex nested JSON structures
  • 📈 Generate reports from JSON data
  • 🎨 Display semi-structured data in tables

License

MIT

Links