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 🙏

© 2025 – Pkg Stats / Ryan Hefner

json-viewer-plus

v0.0.2-alpha.5

Published

A sophisticated, high-performance React JSON Viewer component with advanced formatting, search, export, and accessibility features

Readme

JSON Viewer Plus

A sophisticated, high-performance React JSON Viewer component with advanced formatting, search, export, and accessibility features.

Features

🔍 Advanced Search - Search through JSON keys and values with regex support
📤 Export Options - Export to JSON, pretty JSON, and CSV formats
🎨 Theme Support - Light, dark, system, and custom theme support
Accessible - Full keyboard navigation and screen reader support
High Performance - Optimized for large JSON datasets with virtualization
🎯 TypeScript - Full TypeScript support with comprehensive type definitions
🔧 Customizable - Custom formatters, renderers, and extensive configuration options

Installation

npm install json-viewer-plus
# or
yarn add json-viewer-plus
# or
pnpm add json-viewer-plus

Quick Start

import React from 'react';
import { JsonViewer } from 'json-viewer-plus';
// Import the CSS for styling
import 'json-viewer-plus/styles';

const data = {
  name: "John Doe",
  age: 30,
  hobbies: ["reading", "coding", "hiking"],
  address: {
    street: "123 Main St",
    city: "Anytown",
    zip: "12345"
  }
};

function App() {
  return (
    <div>
      <h1>My JSON Data</h1>
      <JsonViewer
        data={data}
        theme="light"
        searchable={true}
        exportable={true}
        expandDepth={2}
      />
    </div>
  );
}

export default App;

CSS Import Options

The component comes with pre-built CSS that needs to be imported:

// Option 1: Import via package alias (recommended)
import 'json-viewer-plus/styles';

// Option 2: Import the CSS file directly
import 'json-viewer-plus/dist/json-viewer.css';

// Option 3: In your HTML or CSS bundle tool
// Link to: node_modules/json-viewer-plus/dist/json-viewer.css

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | data | unknown | required | The JSON data to display | | theme | 'light' \| 'dark' \| 'system' \| CustomTheme | 'system' | Theme for the viewer | | searchable | boolean | true | Enable search functionality | | exportable | boolean | true | Enable export functionality | | expandDepth | number | 2 | Initial expansion depth | | formatters | FormatterConfig[] | [] | Custom value formatters | | onNodeClick | function | - | Callback when a node is clicked | | onExport | function | - | Callback when data is exported |

Advanced Usage

Custom Formatters

const formatters = [
  {
    path: /.*timestamp$/i,
    type: 'date',
    format: 'PPpp', // date-fns format
  },
  {
    path: 'user.email',
    type: 'custom',
    format: (value) => value.replace(/(.{3}).*(@.*)/, '$1***$2') // Mask email
  }
];

<JsonViewer data={data} formatters={formatters} />

Custom Theme

const customTheme = {
  background: '#1a1a1a',
  textColor: '#ffffff',
  keyColor: '#61dafb',
  stringColor: '#98d982',
  numberColor: '#f08d49',
  booleanColor: '#f92672',
  nullColor: '#75715e'
};

<JsonViewer data={data} theme={customTheme} />

Development

This package is built with:

  • React 18+
  • TypeScript
  • Tailwind CSS 4
  • Vite
  • Vitest for testing
  • Storybook for component development

See CLAUDE.md for detailed development documentation.

License

MIT

Contributing

Contributions are welcome! Please see our contribution guidelines.