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

express-setup-kit

v1.0.0

Published

Basic Express.js setup generator with ready-to-use server boilerplate.

Readme

🚀 Express Setup Kit

npm version License: MIT Node.js GitHub release GitHub stars GitHub issues

⚡ A powerful CLI tool to instantly scaffold a production-ready Express.js server with best practices and modern folder structure.

Say goodbye to repetitive Express.js setup! Express Setup Kit generates a complete, organized Express server boilerplate in seconds, so you can focus on building your application logic rather than configuring the basics.

✨ Features

  • 🎯 Zero Configuration - Get started instantly with sensible defaults
  • 📁 Organized Structure - Professional folder organization following industry standards
  • 🔒 Security First - Comes with Helmet.js and CORS pre-configured
  • 📊 Logging Ready - Morgan logger integrated for request tracking
  • 🌍 Environment Variables - Dotenv setup with .env file generation
  • 🚀 Hot Reload - Nodemon configured for development workflow
  • 🏥 Health Check - Built-in health endpoint for monitoring
  • 🛡️ Error Handling - Centralized error handling middleware
  • 💾 Database Ready - Placeholder for database connection setup

📦 Installation

Global Installation (Recommended)

npm install -g express-setup-kit

One-time Usage with npx

npx express-setup-kit

🚀 Quick Start

  1. Run the CLI tool:

    express-setup-kit
  2. Enter your project name when prompted (default: "server")

  3. Install dependencies when asked (recommended: Yes)

  4. Navigate to your project and start coding:

    cd your-project-name
    npm run dev

Your Express server will be running at http://localhost:8080 🎉

📋 What Gets Generated

📁 Project Structure

your-project/
├── src/
│   ├── config/
│   │   └── db.js              # Database configuration
│   ├── controllers/           # Route controllers
│   ├── middlewares/
│   │   └── errorHandler.js    # Centralized error handling
│   ├── models/                # Data models
│   ├── routes/                # API routes
│   ├── utils/                 # Utility functions
│   └── server.js              # Main application file
├── .env                       # Environment variables
└── package.json              # Dependencies and scripts

🛠️ Generated Files

src/server.js - Main Application

  • Express app configuration
  • Middleware setup (CORS, Helmet, Morgan)
  • Health check endpoint (/health)
  • Welcome route (/)
  • Error handling middleware
  • Server startup logic

src/config/db.js - Database Configuration

  • Database connection placeholder
  • Ready to integrate with MongoDB, PostgreSQL, MySQL, etc.

src/middlewares/errorHandler.js - Error Handling

  • Centralized error handling middleware
  • Proper error responses and logging

.env - Environment Variables

  • PORT configuration (default: 8080)
  • Ready for additional environment variables

📦 Included Dependencies

Production Dependencies:

  • express ^4.18.2 - Fast, unopinionated web framework
  • cors ^2.8.5 - Cross-Origin Resource Sharing middleware
  • helmet ^7.0.0 - Security middleware for HTTP headers
  • morgan ^1.10.0 - HTTP request logging middleware
  • dotenv ^16.0.3 - Environment variable loader

Development Dependencies:

  • nodemon ^3.1.0 - Auto-restart during development

🎯 Available Scripts

npm start     # Start production server
npm run dev   # Start development server with auto-reload

🔧 Customization

Environment Variables

The generated .env file includes:

PORT=8080

Add more variables as needed:

PORT=8080
NODE_ENV=development
DB_URL=mongodb://localhost:27017/myapp
JWT_SECRET=your-secret-key

Database Integration

Replace the placeholder in src/config/db.js:

MongoDB Example:

import mongoose from 'mongoose';

export const connectDB = async () => {
  try {
    await mongoose.connect(process.env.DB_URL);
    console.log('✅ MongoDB connected successfully');
  } catch (error) {
    console.error('❌ Database connection failed:', error.message);
    process.exit(1);
  }
};

PostgreSQL Example:

import pkg from 'pg';
const { Pool } = pkg;

const pool = new Pool({
  connectionString: process.env.DB_URL,
});

export const connectDB = async () => {
  try {
    await pool.connect();
    console.log('✅ PostgreSQL connected successfully');
  } catch (error) {
    console.error('❌ Database connection failed:', error.message);
    process.exit(1);
  }
};

🛣️ Adding Routes

Create route files in src/routes/:

// src/routes/users.js
import express from 'express';
const router = express.Router();

router.get('/', (req, res) => {
  res.json({ message: 'Users endpoint' });
});

router.post('/', (req, res) => {
  // Create user logic
  res.json({ message: 'User created' });
});

export default router;

Import and use in server.js:

import userRoutes from './routes/users.js';
app.use('/api/users', userRoutes);

🏥 Health Check

The generated server includes a built-in health check endpoint:

GET /health

Response:

{
  "status": "OK",
  "message": "All systems operational",
  "timestamp": "2025-09-28T10:30:00.000Z"
}

🔒 Security Features

  • Helmet.js - Sets various HTTP headers for security
  • CORS - Configurable Cross-Origin Resource Sharing
  • Error Handling - Prevents sensitive information leakage
  • Input Validation - Express built-in body parsing with limits

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙋‍♂️ Author

Arpit Rai

⭐ Show Your Support

Give a ⭐️ if this project helped you!

📚 Changelog

v1.0.0

  • Initial release
  • Basic Express.js server generation
  • Folder structure scaffolding
  • Essential middleware integration
  • Environment variable setup