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

json-driven-npm

v1.3.1

Published

Architectural blueprint and reference implementation for building clean, type-safe, JSON-driven NPM clients without folder sprawl.

Downloads

396

Readme

JSON-Driven NPM Architecture

license node docs npx

An architectural source of truth and living reference implementation for building scalable, type-safe API clients in JavaScript and TypeScript without physical directory sprawl.

Zero Code Transport: This package is not a template generator and does not copy code into other directories. It is an educational reference that executes what it has inside, exposing its internal structure, routes, and data live via npm and npx.

Explore the Documentation Hub → · Active v3 Architecture → · CLI Runner →


The Core Concept: Endpoints as Data

In conventional client libraries, adding 50 endpoints requires creating 50 nested directories and 50 repetitive boilerplate files:

src/
└── users/
    ├── profile/fetch.js
    └── settings/fetch.js
└── reports/
    ├── summary/fetch.js
    └── metrics/fetch.js

In a JSON-Driven Architecture, endpoints are structured data:

src/v3/
├── api.json              # Public allowlist: explicit array of exposed route paths
├── source.json           # Domain contract: resource metadata, descriptions, & data
├── index.js              # Composition root: mounts the in-memory client tree
└── internal-working/
    ├── route/            # Assembly engine: mounts dot-paths into nested callable objects
    └── execution/        # Pipeline: validates input, retrieves spec, and dispatches queries

Two Ways to Use & Explore

This package is designed to be explored in two complementary ways:

1. Via npx (Live Terminal Inspector)

Run json-driven-npm directly from your command line to inspect the in-memory structure and execute endpoints live:

# Run the live showcase of all exposed endpoints
npx json-driven-npm

# List all public route paths from api.json
npx json-driven-npm --routes

# Execute a single endpoint path
npx json-driven-npm --run app.founder.profile.fetch
npx json-driven-npm --run app.ecosystem.packages.fetch

See bin/README.md for complete CLI details.


2. Via npm (Programmatic Import)

Import json-driven-npm in Node.js to use the natural, nested, dot-notation client tree:

import app from "json-driven-npm";

// 1. Fetch founder & software architect profile
const profile = await app.founder.profile.fetch();
console.log(profile);
// {
//   name: "Keshav Nalam",
//   role: "Software Architect & Developer",
//   company: "KeshavSoft",
//   location: "India",
//   bio: "Creator of zero-dependency, declarative, JSON-driven NPM architectures."
// }

// 2. Fetch official links
const links = await app.founder.links.fetch();
console.log(links.github); // "https://github.com/keshavsoft"

// 3. Fetch company engineering philosophy
const company = await app.company.info.fetch();
console.log(company.philosophy);
// "Zero-dependency architectures, declarative pipelines, and zero folder sprawl"

// 4. Fetch flagship ecosystem packages
const packages = await app.ecosystem.packages.fetch();
console.log(packages);

How to Build Your Own JSON-Driven Package

json-driven-npm serves as the reference blueprint. When you build your own package:

┌─────────────────────────────────┐       ┌─────────────────────────────────┐
│         json-driven-npm         │       │       create-intellisense       │
│   (Architectural Reference)     │       │       (Companion Generator)     │
├─────────────────────────────────┤       ├─────────────────────────────────┤
│ • Learn the JSON-driven pattern │       │ • Run in your own project       │
│ • Study the 3 clean layers      │ ────► │ • Reads your api.json & source  │
│ • Understand in-memory mounting │       │ • Emits your custom index.d.ts  │
│ • Zero directory sprawl         │       │ • Instant IDE autocomplete      │
└─────────────────────────────────┘       └─────────────────────────────────┘
  1. Adopt the Structure in Your Repo:
    • Create your api.json with your allowed dot-separated paths.
    • Create your source.json (or structure.json) with your domain specifications and JSDoc descriptions.
    • Wire your internal-working/route/ and internal-working/execution/ to mount your tree.
  2. Add Custom Execution Logic:
    • internal-working/execution/ is the only place you implement your custom fetch, database, or transport logic.
  3. Use create-intellisense for Type Safety:
    • Install create-intellisense as a devDependency in your package:
      npm install -D create-intellisense
    • Run npx create-intellisense to generate your src/index.d.ts directly from your JSON contracts.

Adding a New Endpoint in Your Package (Zero New JS Files)

To expose a new endpoint like app.ecosystem.stats.fetch:

  1. Add specification to source.json:

    "ecosystem": {
        "stats": {
            "fetch": {
                "action": "fetch",
                "resource": "stats",
                "description": "Fetches download and star metrics across packages."
            }
        }
    }
  2. Expose the path in api.json:

    "app.ecosystem.stats.fetch"
  3. Generate TypeScript declarations:

    npx create-intellisense

Done. The route is immediately callable with full VS Code autocomplete, parameter hints, and type checking—with zero new .js files or folder sprawl.


Core Engineering Principles

Every module in this repository adheres to KeshavSoft standards:

  1. Strictly One Default Export: Every file exports exactly one item using export default startFunc;. Named exports are prohibited.
  2. Standardized Parameter Unwrapping: All functions accept a single object with in-prefixed keys, which are immediately unwrapped into local-prefixed variables:
    const startFunc = ({ inRoutePath, inParam, inSource }) => {
        const localRoutePath = inRoutePath;
        const localParam = inParam;
        const localSource = inSource;
        // ...
    };
    export default startFunc;
  3. Pure Domain Decoupling: source.json is the sole source of truth for domain metadata, kept strictly decoupled from transport and execution logic.

Repository Guide Map

Explore the modular documentation across the project:


License

MIT © KeshavSoft