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

kschema-build-endpoints

v1.7.4

Published

find the json files in ui, and insert column config

Downloads

179

Readme

KSchema Build Endpoints

Transform an Express.js project into a structured knowledge model.


Vision

The objective of this project is not to generate Swagger directly.

The objective is to understand the application's architecture by converting its folder structure, files, routes, endpoints, imports, exports and relationships into a structured JSON knowledge graph.

Once the knowledge graph exists, multiple outputs become possible.

  • Swagger / OpenAPI
  • HTML Documentation
  • Dependency Graphs
  • AI Knowledge Base
  • Reverse Engineering
  • Architecture Reports
  • Code Navigation
  • Automatic Refactoring
  • API Visualization

The JSON is the source of truth.

Everything else is generated from it.


Overall Pipeline

Express Project
      │
      ▼
node-fs-recursive
      │
      ▼
Array<FilePath>
      │
      ▼
node-fs-read-content
      │
      ▼
Array<FileObject>
      │
      ▼
kschema-pull-endpoints
      │
      ▼
Endpoint Files
      │
      ▼
kschema-pull-methods
      │
      ▼
Story Builder
      │
      ▼
Knowledge JSON
      │
      ├────────► Swagger
      │
      ├────────► HTML Documentation
      │
      ├────────► Dependency Graph
      │
      └────────► AI Processing

Package Responsibilities

node-fs-recursive

Responsibility

Discover files.

Input

Folder Path
Target File Name

Output

Array<String>

[
    "/api/v1/customers/end-points.js",
    "/api/v1/products/end-points.js"
]

node-fs-read-content

Responsibility

Read file contents.

Input

Array<FilePath>

Output

[
    {
        nameWithOutExtension,
        extension,
        basename,
        fileFullPath,
        fileContent
    }
]

This package performs no parsing.

It only converts

File Path

↓

Structured File Object

kschema-pull-endpoints

Responsibility

Locate endpoint files.

Current target

end-points.js

Output

Array<FilePath>

kschema-pull-methods

Responsibility

Understand endpoint files.

Current responsibility

  • Find router.get()
  • Find router.post()
  • Find router.put()
  • Find router.delete()
  • Find router.patch()

Convert every endpoint into a Story object.


buildStory()

Current implementation

File Content

↓

Pattern Collector

↓

Regex Parser

↓

Story Object

Current Story

{
    filePath,
    line,
    lineNumber,
    method,
    endPoint,
    funcToRun
}

Current Architecture

Folder Discovery

↓

Read Files

↓

Extract Interesting Lines

↓

Apply Regex

↓

Split Regex Parts

↓

Build Story

↓

Return JSON

Each stage has exactly one responsibility.


Design Principles

Single Responsibility

Every package should solve only one problem.


Immutable Pipeline

Each package receives data.

Each package returns richer data.

No package should modify previous stages.


Memory First

Files are read once.

Parsing should happen in memory.

Avoid repeated File System access.


Data Driven

Business logic should eventually move into configuration.

Example

Instead of

parseRegex3

the parser should receive

{
    regex,
    outputMapping,
    parserConfiguration
}

making the parser generic.


Current Roadmap

Phase 1

✔ Discover endpoint files

✔ Read contents

✔ Extract methods

✔ Build endpoint story


Phase 2

Generalize

buildStory()

using external parser definitions.


Phase 3

Support

  • app.js
  • routes.js
  • end-points.js

using one common parsing engine.


Phase 4

Merge all stories into one Knowledge Graph.


Phase 5

Generate

  • Swagger
  • HTML Documentation
  • Dependency Tree
  • API Explorer
  • AI Documentation

Current Status

Completed

  • File discovery
  • File reading
  • Endpoint discovery
  • Method extraction
  • Story generation

In Progress

  • Generalization
  • Knowledge Graph

Future

  • Full Express Project Modeling
  • Swagger Generation
  • Visual Documentation
  • AI-ready Architecture JSON

Documentation

Comprehensive design manuals and specification details can be found under the docs/ directory:


Philosophy

The project is not parsing JavaScript.

The project is understanding JavaScript.

The final objective is to transform an application's architecture into a structured knowledge model that can be consumed by both humans and machines.