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

entities-ui

v0.0.6

Published

Generate schema docs for various schema types

Readme

Entity UI

Table of Contents

Overview

Entity Docs Generator is a TypeScript-based library that automates the creation of entity UI. It provides decorators for defining table and column properties, and dynamically generates an HTML representation of the schema. see example output below

Logo

Installation

To use this library in your project, install it via npm:

npm install entities-ui

Decorators

@Table

The Table decorator defines metadata for database tables.

Properties

| Property | Type | Required | Default | Description | | ----------------- | -------- | -------- | ------- | ------------------------------------------- | | name | string | No | - | The name of the table in the database | | description | string | No | - | Human-readable column description for table |

Example:

import { Table, Props } from "entity-generator";

@Table({
  name: "users",
  description: "Users table",
})
class TestUser {
  first_name: string;
  last_name: string;
}

@Props

The Props decorator defines column properties for a table.

Properties

| Property | Type | Required | Default | Description | | ----------------- | ------------- | -------- | ------- | ------------------------------------------------------------------------ | | name | string | No | - | The name of the column in the database table | | type | SqlDataType | Yes | - | The SQL data type for the column (e.g., VARCHAR, INTEGER, BOOLEAN) | | nullable | boolean | No | false | Whether the column allows NULL values. | | default | any | No | - | Default value for the column. | | primary_key | boolean | No | false | Whether the column is a PRIMARY KEY | | indexed | boolean | No | false | Whether to create an index for this column | | example | any | No | - | Example value for documentation purposes | | description | string | No | - | Human-readable column description for documentation |

Example Usage

Example:

class Product {
  @Props({
    type: "String",
    name: "first_name",
    nullable: false,
    example: "John",
    description: "First name of the user",
  })
  first_name: string;
  @Props({
    type: "String",
    name: "last_name",
    nullable: false,
    example: "Doe",
    description: "Last name of the user",
  })
  last_name: string;
}

TypeOrm

@Table({
  name: "users",
  description: "Users table",
})
@Entity()
class User {
  @Column({
    type: "varchar",
  })
  @Props({
    type: "String",
    name: "first_name",
    nullable: false,
    example: "John",
    description: "First name of the user",
  })
  first_name: string;

  @Column({
    type: "varchar",
  })
  @Props({
    type: "String",
    name: "last_name",
    nullable: false,
    example: "Doe",
    description: "Last name of the user",
  })
  last_name: string;
}

Mongoose

@Table({
  name: "users",
  description: "Users table",
})
@Schema({ timestamps: true })
export class Product extends Document {
  @Prop({
    type: String,
  })
  @Props({
    type: "String",
    name: "first_name",
    nullable: false,
    example: "John",
    description: "First name of the user",
  })
  first_name: string;

  @Prop({
    type: String,
  })
  @Props({
    type: "String",
    name: "last_name",
    nullable: false,
    example: "Doe",
    description: "Last name of the user",
  })
  last_name: string;
}

Initializing Schema Generator

To generate documentation, initialize the EntityGenerator with the defined entities and the Express app instance.

Express App

import { express } from "express";

const schema = EntityGenerator.initialize([User, Product], app)
  .addEntities()
  .setTitle("Entity UI")
  .setDescription(
    "This document provides an overview of all database tables and their columns."
  )
  .setVersion("0.0.1")
  .build();
const app = express();
app.get("/api-docs", (req, res) => {
  res.send(schema);
});

Nestjs App

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  const schemas = EntityGenerator.initialize([Users])
    .setTitle("Entity UI")
    .setDescription(
      "This document provides an overview of all database tables and their columns."
    )
    .setVersion("0.0.1")
    .build();

  const expressApp = app.getHttpAdapter().getInstance();
  expressApp.get("/api-docs", (req, res) => res.send(schemas));

  await app.listen(process.env.PORT ?? 3000);
}
bootstrap();

Use Cases

  • Database Documentation: Automatically generate schema documentation UI for your database tables.
  • API Development: Define structured metadata for your database and expose it via an endpoint.
  • Data Validation: Ensure consistency in table and column definitions across projects.

License

This library is licensed under the MIT License.