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-quick-setup

v1.2.1

Published

A simple and quick setup for building RESTful APIs with Express.js. This package provides an easy way to scaffold an Express.js project with essential features like controllers, models, routes, middleware, and API documentation using Swagger.

Readme

Express Quick Setup

A simple and quick setup for building RESTful APIs with Express.js. This package provides an easy way to scaffold an Express.js project with essential features like controllers, models, routes, middleware, and API documentation using Swagger.

Features

  • Express.js setup for rapid API development.
  • Pre-configured project structure with controllers, models, routes, and middleware directories.
  • Example files to get you started:
    • userController.js for handling user registration and login.
    • userModel.js for the User schema in MongoDB.
    • Swagger API documentation for easy testing and API exploration.
  • JWT authentication middleware for protecting routes.
  • Swagger UI integrated for interactive API documentation.

Getting Started

Installation

  1. Install the package globally to use the project initializer anywhere:
    npm install -g express-quick-setup
2. **Initialize a new project:**

 ```bash
express-quick-setup <project-name>

This will create a new directory called with a pre-configured Express project.

Project Structure

After running the express-quick-setup, the project will be structured as follows:


<project-name>/
│
├── controllers/
│   ├── userController.js         # Example controller for handling user-related routes.
│
├── models/
│   ├── userModel.js              # Mongoose model for the User schema.
│
├── routes/
│   ├── userRoutes.js             # Routes for user-related actions.
│
├── middleware/
│   ├── authMiddleware.js         # JWT authentication middleware.
│
├── .env                          # Environment variables (e.g., DB URI, JWT secret).
├── package.json                  # NPM dependencies and scripts.
├── server.js                     # Main server file, sets up API routes and Swagger UI.
└── api-docs/                     # Generated Swagger documentation (accessible via /api-docs).

Configuration

Environment Variables:

Create a .env file with the following variables:


PORT=3000
DB_URI=mongodb://localhost:27017/express-quick-setup
JWT_SECRET=your_jwt_secret

Swagger API Documentation:

  • The API documentation is automatically generated and accessible via http://localhost:3000/api-docs.
  • Swagger will allow you to interact with the API and test the endpoints.

Usage

  1. Start the Project:
cd <project-name>
npm install
npm start
  1. Access the API Documentation:
  • Open http://localhost:3000/api-docs in your browser.
  • You can test the POST /api/users/register and POST /api/users/login endpoints via the Swagger UI.
  1. Available Routes:
  • POST /api/users/register: Register a new user.
  • POST /api/users/login: Login an existing user.
  • POST /api/protected: A protected route that requires JWT authentication (e.g., access with Bearer ).

Example Request

Register a User URL: /api/users/register Method: POST Request Body:

{
  "username": "john_doe",
  "email": "[email protected]",
  "password": "password123"
}

Login a User URL: /api/users/login Method: POST Request Body:

{
  "email": "[email protected]",
  "password": "password123"
}

Access a Protected Route URL: /api/protected Method: POST Headers:

{
  "Authorization": "Bearer <jwt-token>"
}

API Documentation

  • Swagger UI is integrated into the project. Once you run the project, you can access it at http://localhost:3000/api-docs to view and interact with the API documentation. Swagger will display - all available routes, request parameters, and responses.

Dependencies

  • express: Web framework for Node.js.
  • mongoose: MongoDB object modeling for Node.js.
  • dotenv: Load environment variables from .env.
  • jsonwebtoken: JSON Web Token (JWT) for authentication.
  • swagger-ui-express: Swagger UI for API documentation.
  • swagger-jsdoc: Swagger JSDoc to generate API documentation from JSDoc comments.

License

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