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

create-nepbs

v1.0.5

Published

NEPBS - Node Express Prisma Backend Server generator for JavaScript and TypeScript.

Readme

NEPBS

Node Express Prisma Backend Server

npm version npm downloads license

NEPBS is an interactive command-line generator for creating a ready-to-use Node.js, Express, and Prisma backend. It helps you start a new backend project with TypeScript or JavaScript, a supported database, Prisma configuration, environment files, validation utilities, and a clean source structure.

NEPBS is a starter generator, not a complete application. It does not create authentication routes, CRUD modules, payment logic, or application-specific business rules automatically.

Contents

Features

  • Interactive TypeScript or JavaScript selection
  • Support for PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, CockroachDB, and MongoDB
  • Prisma 6.19 compatibility profile
  • Prisma 7 profile with database adapters and drivers
  • Prisma 8 contract-based profile for PostgreSQL and MongoDB
  • Express application starter with /api/v1 health endpoint
  • Zod request validation middleware and starter user schema
  • Environment configuration with dotenv
  • CORS and cookie parsing middleware
  • JWT and bcrypt helper utilities
  • Global error handling and not-found handling
  • Automatic dependency installation
  • Automatic Prisma client or contract artifact generation
  • Generated project build verification
  • Exact resolved direct dependency versions saved to package.json and package-lock.json

Quick start

Run the generator with npx:

npx create-nepbs my-api

NEPBS will ask you to choose a language, database, and compatible Prisma profile. After you answer, it will:

  1. Create the project directory.
  2. Copy the selected language template.
  3. Generate the Prisma files for your selected profile.
  4. Create .env and .env.example files.
  5. Generate a project-specific package.json.
  6. Install the required packages.
  7. Generate Prisma client or contract artifacts.
  8. Build/check the generated project.

Then enter the project:

cd my-api

Review and update .env. For a relational database, create the initial migration:

npm run prisma:migrate -- --name init

Finally, start the development server:

npm run dev

The starter endpoint is available at:

http://localhost:5000/api/v1

Expected response:

{
  "success": true,
  "message": "API is running"
}

Requirements

  • Node.js: major version 19 through 24
  • npm: included with Node.js
  • An empty or not-yet-created target folder
  • A database server or hosted database for the selected database

Check your local versions:

node --version
npm --version

For production, use a currently supported Node.js LTS release.

Node.js and Prisma compatibility

NEPBS checks your Node.js version before generating a project.

  • Prisma 7 is offered for Node 20.19+, 22.12+, and 24.x.
  • Prisma 8 is offered for Node 22.18+ or 24.11+.
  • Older supported runtime combinations may use the Prisma 6.19 compatibility profile.
  • Odd-numbered Node.js releases such as 19, 21, and 23 are accepted within the supported range, but NEPBS displays a warning because they are not recommended Prisma production runtimes.

Unsupported Node.js versions are rejected before project creation.

How the generator works

The generator follows this workflow:

npx create-nepbs my-api
        |
        v
Choose a language
        |
        v
Choose a database
        |
        v
Choose a compatible Prisma profile
        |
        v
Create project files
        |
        v
Install dependencies
        |
        v
Generate Prisma artifacts
        |
        v
Build and verify the project

Language prompt

Choose your language:

1. TypeScript
2. JavaScript

Enter your choice [1]:

Press Enter to select TypeScript, or enter 2 for JavaScript.

Database prompt

Choose your database:

1. PostgreSQL
2. MySQL
3. MariaDB
4. SQLite
5. SQL Server
6. CockroachDB
7. MongoDB

Enter your choice [1]:

Press Enter to select PostgreSQL.

Prisma prompt

The Prisma list depends on your selected database and Node.js version. Unsupported combinations are not shown. The first available option is selected when you press Enter.

Choose a language

TypeScript

The TypeScript template uses:

  • ES modules
  • Strict TypeScript
  • NodeNext module resolution
  • tsx for development
  • tsc for builds
  • Explicit module extensions for Node.js ESM compatibility

Example import:

import app from "./app.js";

JavaScript

The JavaScript template uses:

  • ES modules
  • JavaScript source files
  • Node.js watch mode for development
  • The same core folders and starter utilities as the TypeScript template

Example import:

import express from "express";

Choose a database

| Choice | Prisma provider | Notes | | --- | --- | --- | | PostgreSQL | postgresql | Default choice | | MySQL | mysql | Uses MySQL connector and driver | | MariaDB | mysql | Uses Prisma's MySQL connector | | SQLite | sqlite | Uses a local database file by default | | SQL Server | sqlserver | Microsoft SQL Server | | CockroachDB | cockroachdb | PostgreSQL-compatible adapter setup | | MongoDB | mongodb | Uses Prisma 6.19 compatibility or Prisma 8 |

Hosted database services can be used when they provide a compatible connection string. Put the connection string in .env as DATABASE_URL.

Choose a Prisma profile

| Profile | Databases offered by NEPBS | Node.js requirement | | --- | --- | --- | | Prisma 7 | PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, CockroachDB | Node 20.19+, 22.12+, or 24.x | | Prisma 8 / Latest | PostgreSQL and MongoDB | Node 22.18+ or 24.11+ | | Prisma 6.19 compatibility | MongoDB and combinations where Prisma 7 is unavailable | Available on other supported Node.js versions |

Prisma 7 does not support MongoDB. For MongoDB, NEPBS offers Prisma 6.19 compatibility or Prisma 8 when the runtime supports it.

The Prisma 8 profile is currently treated by this project as a release-candidate/early-access setup. Prisma 8 uses different packages, contract files, and commands from Prisma 6 and Prisma 7. Review the current Prisma release status before using it in production.

The Latest option currently resolves to the Prisma 8 toolchain. Because latest follows the npm registry, the resolved package versions may change over time. NEPBS records the resolved direct dependency versions after installation.

Generated project structure

A generated project has a structure similar to this:

my-api/
├── src/
│   ├── modules/                 # Application modules and features
│   ├── middleware/              # Validation and error middleware
│   ├── utils/                   # Reusable helpers
│   ├── validations/             # Zod schemas
│   ├── config/                  # Environment configuration
│   ├── lib/
│   │   └── prisma.ts or prisma.js
│   ├── app.ts or app.js         # Express app and middleware
│   ├── server.ts or server.js   # Database connection and HTTP server
│   └── index.ts or index.js     # Application entry point
├── prisma/
│   └── schema.prisma            # Prisma 6/7 profiles
├── src/prisma/
│   └── contract.prisma          # Prisma 8 profile
├── .env
├── .env.example
├── .gitignore
├── package.json
├── package-lock.json
├── tsconfig.json                # TypeScript projects/profiles
└── README.md

The Prisma folders are profile-specific:

  • Prisma 6 and Prisma 7 use prisma/schema.prisma.
  • Prisma 7 also generates prisma.config.ts and the client under src/generated/prisma/.
  • Prisma 8 uses src/prisma/contract.prisma, prisma.config.ts, and generated contract artifacts under src/prisma/.

NEPBS creates src/modules/ for your own features. It does not generate authentication routes or CRUD endpoints by default.

Configure environment variables

NEPBS generates .env and .env.example with starter values:

NODE_ENV=development
PORT=5000
DATABASE_URL="postgresql://postgres:your_password@localhost:5432/your_database?schema=public"
FRONTEND_URL=http://localhost:5173
BACKEND_URL=http://localhost:5000
BCRYPT_SALT_ROUNDS=12
JWT_ACCESS_SECRET=your_access_secret_key
JWT_REFRESH_SECRET=your_refresh_secret_key
JWT_ACCESS_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d

Replace the sample values before using the project with a real database:

  • DATABASE_URL
  • Database name, username, and password
  • JWT_ACCESS_SECRET
  • JWT_REFRESH_SECRET
  • FRONTEND_URL, if your frontend runs elsewhere
  • PORT, if port 5000 is already in use

Never commit real credentials or secrets to Git.

Database URL examples

PostgreSQL:

DATABASE_URL="postgresql://username:password@localhost:5432/my_database?schema=public"

MySQL or MariaDB:

DATABASE_URL="mysql://username:password@localhost:3306/database_name"

SQLite:

DATABASE_URL="file:./prisma/dev.db"

SQL Server:

DATABASE_URL="sqlserver://localhost:1433;database=database_name;user=sa;password=YourPassword;encrypt=true;trustServerCertificate=true"

CockroachDB:

DATABASE_URL="postgresql://username:password@localhost:26257/database_name?sslmode=require"

MongoDB:

DATABASE_URL="mongodb://localhost:27017/database_name"

.env and .env.example

  • .env contains local secrets and real connection values. It should not be committed.
  • .env.example documents the required variables without containing real credentials.

Initialize the database

Always update DATABASE_URL before running database commands.

Prisma 6.19 or Prisma 7 with a relational database

Create and apply the initial development migration:

npm run prisma:migrate -- --name init

This applies to PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, and CockroachDB.

For later schema changes:

npm run prisma:migrate -- --name add-profile-model

Prisma 6.19 with MongoDB

MongoDB uses schema push instead of Prisma Migrate:

npm run prisma:push

Prisma 8

Initialize the Prisma 8 contract and database:

npm run prisma:generate
npm run prisma:init

For later contract changes:

npm run prisma:generate
npm run prisma:plan -- --name add-profile-model
npm run prisma:migrate

Prisma 8 does not use the Prisma 6/7 prisma migrate dev workflow.

Available npm scripts

Common scripts

| Script | Purpose | | --- | --- | | npm run dev | Start the development server with file watching | | npm run build | Compile TypeScript or check JavaScript source syntax | | npm run start | Start the production entry point | | npm run prisma:generate | Generate the Prisma client or Prisma 8 contract artifacts |

Prisma 6 and Prisma 7 scripts

| Script | Purpose | | --- | --- | | npm run prisma:migrate -- --name init | Create and apply a development migration for relational databases | | npm run prisma:push | Push the schema without creating migration files | | npm run prisma:studio | Open Prisma Studio |

For the Prisma 6 MongoDB profile, the prisma:migrate script is mapped to prisma db push.

Prisma 8 scripts

| Script | Purpose | | --- | --- | | npm run prisma:init | Initialize the selected Prisma 8 database | | npm run prisma:plan -- --name add-model | Create a Prisma 8 migration plan | | npm run prisma:migrate | Apply the Prisma 8 migration workflow |

Packages installed

Every generated project includes these core runtime packages:

| Package | Purpose | | --- | --- | | express | HTTP server and routing | | dotenv | Loads environment variables from .env | | cors | Configures cross-origin requests | | cookie-parser | Reads cookies from incoming requests | | jsonwebtoken | Creates and verifies JWTs | | bcryptjs | Hashes and compares passwords | | zod | Validates request data | | http-status-codes | Provides readable HTTP status codes |

Default TypeScript + PostgreSQL + Prisma 7 setup

For a modern compatible Node.js runtime, the common default selection is TypeScript, PostgreSQL, and Prisma 7. Its direct runtime dependencies are generally:

express
 dotenv
cors
cookie-parser
jsonwebtoken
bcryptjs
zod
http-status-codes
prisma@7
@prisma/client@7
@prisma/adapter-pg
pg

Its TypeScript development dependencies generally include:

typescript
tsx
@types/node
@types/express
@types/cookie-parser
@types/jsonwebtoken
@types/cors
@types/bcryptjs
@types/pg

The exact resolved versions are written to package.json and package-lock.json during generation.

Prisma 6.19 packages

The Prisma 6.19 profile includes:

[email protected]
@prisma/[email protected]

It does not use the Prisma 7 database adapter packages. TypeScript projects also receive TypeScript tooling and relevant type packages.

Prisma 7 database packages

Prisma 7 adds a database adapter and driver according to the selected database:

| Database | Additional runtime packages | | --- | --- | | PostgreSQL | @prisma/adapter-pg, pg | | CockroachDB | @prisma/adapter-pg, pg | | MySQL | @prisma/adapter-mariadb, mariadb | | MariaDB | @prisma/adapter-mariadb, mariadb | | SQLite | @prisma/adapter-better-sqlite3, better-sqlite3 | | SQL Server | @prisma/adapter-mssql, mssql | | MongoDB | Not available in the Prisma 7 profile |

TypeScript projects may also receive:

  • @types/pg for PostgreSQL and CockroachDB
  • @types/better-sqlite3 for SQLite
  • @types/mssql for SQL Server

JavaScript projects using Prisma 7 may still receive TypeScript tooling because Prisma 7 generates TypeScript client files.

Prisma 8 packages

Prisma 8 uses database-specific ORM packages instead of @prisma/client:

  • PostgreSQL: @prisma/orm-postgres
  • MongoDB: @prisma/orm-mongo
  • MongoDB also includes mongodb@7
  • The Prisma CLI is provided by prisma

Packages not installed by default

NEPBS does not install optional tools such as:

  • helmet
  • morgan
  • eslint
  • prettier
  • husky
  • swagger
  • nodemon

Add them later if your project requires them:

npm install helmet morgan
npm install -D eslint prettier

Request validation with Zod

Both templates include a reusable validation middleware and a starter user schema.

Example schema:

import { z } from "zod";

export const createUserSchema = z.object({
  email: z.string().email(),
  password: z.string().min(8),
});

Use the schema in a route:

import { Router } from "express";
import { validateRequest } from "../middleware/validateRequest.js";
import { createUserSchema } from "../validations/user.schema.js";

const router = Router();

router.post(
  "/users",
  validateRequest(createUserSchema),
  (req, res) => {
    res.status(201).json({
      success: true,
      data: req.body,
    });
  },
);

export default router;

When validation succeeds, the parsed data is assigned to req.body. When validation fails, the middleware sends the error to the global error handler with a 400 status.

Included utilities

The generated project includes:

  • Express app, server, and /api/v1 starter endpoint
  • Prisma client setup for the selected database and profile
  • Zod request validation middleware
  • Starter user validation schema
  • Environment variable loading
  • CORS configuration
  • Cookie parsing
  • JWT token creation and verification helpers
  • bcrypt password hashing and comparison helpers
  • Async error wrapper
  • Custom application error class
  • API response helper
  • Global error handler
  • Not-found handler

These utilities are foundations for your application. They do not replace a complete authentication or authorization system.

Adding your own modules

Keep feature code inside src/modules/. A typical feature can use this structure:

src/modules/user/
├── user.route.ts
├── user.controller.ts
├── user.service.ts
├── user.validation.ts
└── user.interface.ts

Recommended responsibilities:

  • Route: Defines the URL and connects middleware.
  • Controller: Reads the request and sends the response.
  • Service: Contains business logic.
  • Validation: Checks incoming data.
  • Prisma/database layer: Reads and writes database data.

Register your router in src/app.ts or src/app.js:

import userRouter from "./modules/user/user.route.js";

app.use("/api/v1/users", userRouter);

Keeping routes, controllers, services, and validation separate makes the project easier to maintain as it grows.

Run and build the API

Start development mode:

npm run dev

Build the project:

npm run build

Start the production entry point:

npm run start

For production, update the environment values, run the required database migrations, set NODE_ENV=production, and use a secure database connection.

Project name rules

The project name:

  • Must not be empty.
  • Must not contain spaces.
  • Must not start with . or -.
  • May contain letters, numbers, dots, hyphens, and underscores.
  • Must point to a new folder or an empty existing folder.

Valid examples:

npx create-nepbs my-api
npx create-nepbs blog_api
npx create-nepbs backend.v2
npx create-nepbs shop-backend-2026

NEPBS refuses to overwrite a non-empty folder.

Global installation

A global installation is not required. The recommended approach is npx:

npx create-nepbs my-app

If you prefer a global installation:

npm install -g create-nepbs
create-nepbs my-app

Repository development

This repository is the CLI generator itself, not a generated backend project.

Source structure

src/
├── index.ts
├── commands/create.ts
├── types.ts
└── utils/
    ├── ask-database.ts
    ├── ask-language.ts
    ├── ask-prisma-version.ts
    ├── create-project.ts
    ├── install-packages.ts
    ├── node-profile.ts
    ├── package-list.ts
    ├── project-name.ts
    ├── render-files.ts
    └── run-command.ts

Install repository dependencies

npm ci

Build the CLI

npm run build

This compiles the CLI into dist/ and makes dist/index.js executable.

Run all checks

npm run check

The check command verifies the CLI TypeScript source, checks the TypeScript template, and runs node --check against important JavaScript template files.

Test the local CLI

After building:

node dist/index.js my-api

The CLI package itself uses commander at runtime. Its package dependencies are separate from the dependencies installed into a generated backend project.

Troubleshooting

Unsupported Node.js version

Check your version:

node --version

Use Node.js 19 through 24. Some Prisma profiles require a newer minor version, so NEPBS may show only the compatible profiles.

Target folder already has files

Choose a different project name or use an empty folder. NEPBS does not replace files in a non-empty folder.

npm install fails

Check that:

  • Your internet connection is working.
  • npm can reach the registry.
  • Your Node.js version is supported.
  • A proxy or firewall is not blocking package downloads.

After fixing the problem, run this inside the generated project:

npm install

Database connection errors

Verify that:

  • The database server is running.
  • The database exists when required.
  • The username and password are correct.
  • The host and port are correct.
  • DATABASE_URL uses the correct protocol.
  • Hosted databases have the required SSL options.

Prisma client is missing

Generate the client or contract artifacts:

npm run prisma:generate

Then build again:

npm run build

Migration errors

For relational databases:

npm run prisma:migrate -- --name init

For MongoDB with Prisma 6.19:

npm run prisma:push

For Prisma 8, use its contract workflow instead of the Prisma 6/7 migration command.

Port is already in use

Change the port in .env:

PORT=5001

Then restart the server.

Security checklist

Before deploying to production:

  • Keep real secrets in .env and never commit them.
  • Use long, random JWT secrets.
  • Store hashed passwords, never plain-text passwords.
  • Restrict CORS to your actual frontend origin.
  • Validate all untrusted input.
  • Enforce authorization on the server.
  • Do not expose stack traces in production responses.
  • Add rate limiting and security headers as needed.
  • Review database migrations before applying them to production.
  • Audit dependencies regularly:
npm audit
npm outdated

What NEPBS does not generate

NEPBS intentionally does not generate the following application-specific features:

  • Login and registration endpoints
  • Complete authentication middleware
  • User CRUD operations
  • Roles and permissions
  • Pagination, filtering, or search
  • File uploads
  • Payment integration
  • Swagger/OpenAPI documentation
  • Automated tests
  • Docker configuration
  • Deployment configuration

Add these features according to your application requirements.

Installation behavior

NEPBS prepares the generated package.json, runs one npm install pass, resolves the required direct dependency versions, writes those versions to package.json and package-lock.json, generates Prisma artifacts, and runs the generated project's build check.

Installation time depends on your network, npm registry access, selected database, and selected Prisma profile.

Useful links


npx create-nepbs my-app