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

schemapi

v1.4.4

Published

The `create` command allows you to create a new schema file. The generated file will be a JSON file containing the essential properties to define a schema.

Readme

Schemapi

Command create

The create command allows you to create a new schema file. The generated file will be a JSON file containing the essential properties to define a schema.

npx schemapi create <schema>

Parameters

  • <schema>: The name of the schema to be created. The generated file will have the format <schema>.schema.json and will be saved in the .schema folder.

Usage Example

To create a new schema called user, run:

npx schemapi create user
Enter the name of your schema: Users
Enter the description of your schema: Model schema of user informations
Enter the length of your schema (can be negative): -30
Enter the seed for your schema: 900

A number indicating the length of the data. If the value is negative, the size of the generated data will vary between 1 and the absolute value of length. If positive, the data will have a fixed size defined by the length value.

Once these values are entered, the schema will be created as a JSON file in the .schema directory.

Command delete

The delete command allows you to delete an entire schema that has already been created. This command removes the corresponding schema file from the .schema folder.

npx schemapi delete <schema>

Parameters

  • <schema>: The name of the schema to be deleted. The corresponding schema file must be located in the .schema folder and have the format <schema>.schema.json.

Usage Example

To delete a schema called user, run:

npx schemapi delete user
Are you sure you want to delete the schema <schema>? (y/N)

Type y (yes) to confirm and delete the schema. Type N (no) or press Enter to cancel the operation and keep the schema.

Command add

The add command allows you to add new properties (content keys) to an existing schema. This command helps you define the types of data that will be generated as well as how the data is constructed.

npx schemapi add <schema>
Enter the key for the new content: key
Select the type of content to add:
   address
   email
   name
   number
   options
   pattern
   schema
   username
   uuid

Depending on the content type chosen, you may be asked for additional configuration options.

Example Usage

To add a new email field to an existing schema called user, run:

npx schemapi add user

The prompts will guide you through entering the key and selecting the type, along with any additional options based on the type selected.

Command remove

The remove command allows you to remove one or more content keys from an existing schema. It will list all available content keys in the schema, and you can select one or more to delete. If no content keys are selected, nothing will be removed.

npx schemapi remove <schema>

Parameters

  • <schema>: The name of the schema from which content keys will be removed. The corresponding schema file must be located in the .schema folder and have the format <schema>.schema.json.

Usage Example

To remove content keys from a schema called user, run:

npx schemapi remove user
Select the keys to remove from content (use space to select multiple or enter to cancel): <key1>, <key2>
Are you sure you want to delete the selected keys: <key1>, <key2>? (y/N)

Type y (yes) to confirm and delete the props of schema. Type N (no) to cancel the operation and keep the props of schema.

Here’s how you can structure the documentation for the server command:


Command server

The server command starts an Express server that serves the schema data stored in the .schema directory. This server will monitor the .schema folder and automatically reload the schemas whenever they are updated, enabling dynamic development. It also provides an HTML interface to view the schemas and their contents.

npx schemapi server -p <port>

Options

  • -p, --port <port>:
    Specify the port on which the server will run. If not provided, the server will default to port 1104.

Example Usage

  1. Start the server with the default port (1104):

    npx schemapi server
  2. Start the server on a custom port (3000):

    npx schemapi server -p 3000

Description of Features

  • Request Logging: Each request to the server will be logged in the console, including details such as HTTP method, status code, and response time.

  • Dynamic Routes for Schemas:
    Every .schema.json file in the .schema directory generates a corresponding route. You can access these routes at http://localhost:<port>/<schemaName>.
    For example, if you have a user.schema.json file, it will be accessible at http://localhost:1104/user.

  • Automatic Schema Reloading:
    The server detects any changes made to the .schema files and automatically reloads them. When a change is detected, a notification is shown in the console.

  • HTML Interface:
    The root route (/) displays a rendered HTML page (using Handlebars) listing all available schemas and their contents. This makes it easy to visualize the data being served.

Example Output

When you run the server, you’ll see logs like:

Server started on port http://localhost:1104

When accessing a specific schema (e.g., user), you will see:

http://localhost:1104/user