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 🙏

© 2025 – Pkg Stats / Ryan Hefner

express-ts-app-generator

v1.0.3

Published

CLI to create Express + TypeScript apps

Readme

Express TS App Generator

A minimal and easy-to-use generator for bootstrapping Express.js projects with TypeScript support out of the box.
This package helps developers save time by setting up a clean project structure, installing essential dependencies, and providing ready-to-use configuration files.


🔧 Installation

You can use this package in two ways:

1. Using npx (recommended)

Run the generator directly without installing globally:

  • npm i express-ts-app-generator

  • npx express-ts-app-generator my-app

  • This will create a new folder called my-app with all files scaffolded.

2. Installing globally -g

  • If you want to use the CLI command without npx

  • npm install -g express-ts-app-generator

  • Then you can generate a project with:

  • express-ts-app-generator my-app

🛠 Usage

  • Once the project is generated:

cd my-app npm install npm run dev


🚀 Features

  • ⚡ Quickly generate a new Express + TypeScript project.
  • 🏗 Pre-configured TypeScript with tsconfig.json.
  • 🔥 Integrated Express.js boilerplate.
  • 🌿 Environment variables handled with dotenv.
  • 🧩 Simple and extensible folder structure.

📦 Packages Used

These are the packages that the generated app will include.

1) Runtime dependencies (always installed)

  • express – Minimal, fast web framework for building HTTP APIs and servers.
  • cors – Express middleware to enable/handle Cross-Origin Resource Sharing.
  • helmet – Security middleware that sets sensible HTTP headers.

2) Optional database dependencies

  • mongoose (MongoDB) – ODM for MongoDB; schema/model layer + helpers for queries/validation.
  • pg (PostgreSQL) – Official PostgreSQL client for Node.js.
  • pg-hstore (PostgreSQL) – Serializer/parser for PostgreSQL hstore data type (commonly used by ORMs like Sequelize; if you don’t use hstore, you might not need it).

3) DevDependencies (always installed)

  • eslint – Pluggable linter to catch problems and enforce code style.
  • prettier – Opinionated code formatter for consistent styling.

4) DevDependencies (only when TypeScript is chosen)

  • typescript – TypeScript compiler and language services.
  • ts-node – Execute TypeScript files directly in Node (useful for scripts/CLIs).
  • tsx – Fast TS/ESM runner (used in the dev script to run src/index.ts without manual build).
  • @types/node – Type definitions for Node.js APIs.
  • @types/express – Type definitions for Express.
  • @types/cors – Type definitions for cors.
  • @types/helmet – Type definitions for helmet.

ℹ️ Notes

  • The generator writes package.json with dev, build, and start scripts. For TypeScript: dev uses tsx, build uses tsc, and start runs the compiled output.
  • .gitignore includes node_modules, dist, and .env by default.

This will start the development server with ts-node-dev (or whichever runner you configured). ❓ Why use this generator?

Setting up Express.js with TypeScript manually can be repetitive:

Creating and configuring tsconfig.json

Installing and setting up express with proper typings

Configuring dotenv for environment variables

Defining folder structure (src/, routes/, controllers/, etc.)

Writing the boilerplate server.ts

👉 This generator automates all those steps, so you can focus on writing actual application logic instead of repeating setup tasks.

📂 Project Structure (generated)

my-app/ ├── src/ │ ├── index.ts # Entry point │ ├── routes/ # Example routes │ ├── controllers/ # Example controllers │ ├── tsconfig.json ├── package.json ├── .env.example

📜 License

MIT © 2025 AmirHosein Ashkani