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

fexapi

v0.3.4

Published

Mock API generation CLI tool for local development and testing

Readme

FexAPI

Frontend Experience API - Mock API generation CLI tool for local development and testing.

Installation

npm install -g fexapi

Usage

fexapi [options]

Prisma-like Flow (Dynamic)

1) Initialize

npx fexapi@latest init

or

pnpm dlx fexapi@latest init

or

yarn dlx fexapi@latest init

or

bunx fexapi@latest init

fexapi init runs an interactive setup wizard and asks:

  • What port? (default: 4000)
  • Enable CORS? (Y/n)

Creates:

  • fexapi/schema.fexapi
  • fexapi.config.js

Tip: if you see old prompts (for example default 3000 or "Generate sample schemas"), run with @latest as shown above to ensure every package manager resolves the same release.

2) Edit schema file

fexapi/schema.fexapi supports readable multi-line route fields (single-line still works):

# Server
port: 4100

# Routes
GET /users:
  id:uuid
  name:name
  email:email
  age:number
  phone:phone
  pic:url
  courseName:string

GET /courses:
  id:uuid
  courseName:string
  mentor:name

# one-line format is also valid:
# GET /users: id:uuid,name:name,email:email

3) Generate artifacts (updates migration)

npx fexapi generate

Generates:

  • fexapi/generated.api.json
  • fexapi/migrations/schema.json

3a) Format schema (optional)

Auto-format your schema to use readable multi-line field formatting:

npx fexapi format

This rewrites fexapi/schema.fexapi with each field on its own indented line for better readability.

4) Start server

npx fexapi run
# or
npx fexapi serve
# request/response logging
npx fexapi serve --log
# or dev watch mode (nodemon-like)
npx fexapi dev --watch
# watch mode + request logs
npx fexapi dev --watch --log
# or (inside local workspace package)
npm run serve

Server port is read from schema.fexapi unless overridden by CLI --port.

fexapi dev --watch auto-reloads when these files change:

  • fexapi/schema.fexapi
  • fexapi/generated.api.json
  • fexapi.config.js
  • fexapi.config.json
  • schemas/*.yaml

fexapi serve --log prints request logs like:

  • [GET] /users/1 → 200 (45ms)
  • [POST] /posts → 201 (12ms)

Configuration File Support

Create a fexapi.config.js in your project root:

// fexapi.config.js
module.exports = {
  port: 3000,
  routes: {
    "/users": { count: 50, schema: "user" },
    "/posts": { count: 100, schema: "post" },
  },
  cors: true,
  delay: 200,
};

Then run:

fexapi serve

Notes:

  • port sets the default server port (CLI --port still has priority).
  • routes maps endpoint paths to generated payload settings.
  • schema maps to files under fexapi/schemas/ (for example schema: "user" -> fexapi/schemas/user.yaml); unknown names fall back to a generic record.
  • cors: true enables CORS headers and OPTIONS preflight handling.
  • delay adds response latency in milliseconds.

Custom Schema Definitions

You can define custom schemas in YAML files under fexapi/schemas/.

# fexapi/schemas/user.yaml
name:
  type: string
  faker: person.fullName
email:
  type: string
  faker: internet.email
age:
  type: number
  min: 18
  max: 80

Then reference it in fexapi.config.js:

routes: {
  "/users": { count: 50, schema: "user" }
}

Notes:

  • Supported file extensions: .yaml, .yml
  • Schema name is taken from filename (for example fexapi/schemas/user.yaml -> schema: "user")
  • faker values map to Faker paths like person.fullName, internet.email

Features

  • Schema-based mock API generation
  • Local development server
  • Faker.js integration
  • Easy setup for testing workflows

License

MIT