express-ts-wizard
v0.2.1
Published
Create production-ready Express.js + TypeScript projects in seconds. Interactive CLI with 3 strictness levels, hot-reload, graceful shutdown, and Express 5.0
Maintainers
Readme
express-ts-wizard
Create production-ready Express.js + TypeScript projects in seconds
The fastest way to bootstrap an Express 5.0 API with TypeScript. Zero config, interactive CLI, multiple strictness levels.
Install
# Run directly with npx (recommended)
npx express-ts-wizard
# Or install globally
npm install -g express-ts-wizard
express-ts-wizardWhy express-ts-wizard?
Setting up a new Express.js project with TypeScript involves a lot of boilerplate: configuring tsconfig.json, setting up hot-reload, adding proper types, handling graceful shutdown... express-ts-wizard does all of this for you in one command.
Features
- Express 5.0 - Latest version with improved async error handling
- TypeScript - Full type safety out of the box
- 3 Strictness Levels - Choose your TypeScript configuration: relaxed, moderate, or strict
- Hot Reload - Development server with instant restarts via
tsx - Production Ready - Graceful shutdown, health check endpoint, proper error handling
- Deterministic Builds - Generates
package-lock.jsonfor reproducible installs - Git Ready - Optional Git initialization with initial commit
- Zero Config - Works immediately after creation, no setup required
Quick Start
npx express-ts-wizardThat's it! Answer 3 simple questions and your project is ready.
cd my-express-app
npm run dev
# Server running at http://localhost:3000Interactive Prompts
The wizard will ask you:
| Prompt | Description | Default |
|--------|-------------|---------|
| Project name | Directory name for your project | my-express-app |
| TypeScript strictness | How strict should TypeScript be? | moderate |
| Initialize Git? | Create a Git repo with initial commit | yes |
Generated Project Structure
my-express-app/
├── src/
│ └── index.ts # Express server with health check
├── package.json # Dependencies and scripts
├── package-lock.json # Lock file for deterministic installs
├── tsconfig.json # TypeScript configuration
└── .gitignore # Standard Node.js ignoresAvailable Scripts
After creating your project, you can run:
| Script | Description |
|--------|-------------|
| npm run dev | Start development server with hot-reload |
| npm run build | Compile TypeScript to JavaScript |
| npm start | Run the compiled production server |
| npm run type-check | Check types without compiling |
TypeScript Strictness Levels
Choose the level that fits your project:
Relaxed
{
"strict": false
}Minimal type checking. Good for quick prototypes or migrating JavaScript projects.
Moderate (Recommended)
{
"strict": true
}Enables TypeScript's strict flag, which includes:
strictNullChecksstrictFunctionTypesstrictBindCallApplystrictPropertyInitializationnoImplicitAnynoImplicitThisalwaysStrict
Strict
{
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true
}Maximum type safety. Catches more potential bugs at compile time.
What's Included
The generated Express server comes with:
// Health check endpoint
app.get("/health", (req, res) => {
res.json({ status: "ok", timestamp: new Date().toISOString() });
});
// Graceful shutdown handling
process.on("SIGTERM", () => gracefulShutdown("SIGTERM"));
process.on("SIGINT", () => gracefulShutdown("SIGINT"));Requirements
- Node.js >= 18.0.0
- npm (comes with Node.js)
- Git (optional, for repository initialization)
Contributing
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Comparison
| Feature | express-ts-wizard | express-generator | create-express-api | |---------|-------------------|-------------------|-------------------| | TypeScript | Yes | No | Varies | | Express 5.0 | Yes | No (4.x) | No | | Interactive CLI | Yes | No | Varies | | Strictness levels | 3 options | N/A | N/A | | Hot reload | Yes (tsx) | No | Varies | | Graceful shutdown | Yes | No | No | | Zero config | Yes | No | Varies |
Related
- Express.js - Fast, unopinionated, minimalist web framework
- TypeScript - Typed JavaScript at any scale
- tsx - TypeScript execute with hot-reload
License
MIT © Simon Oyaneder
If this project helped you, consider giving it a star on GitHub!
