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-js-starter-template

v1.0.3

Published

This package allows you to quickly initialize an Express.js application with a pre-defined folder structure.

Downloads

2

Readme

Express Init

express-init is a command-line tool that helps you quickly initialize a new Express.js application with a pre-defined folder structure. It automates the process of setting up a basic Express app with essential directories and configuration files, allowing you to focus on building your application.

Features

  • Prompts you for the name of your app.

  • Asks if you want to use Zod for validation (optional).

  • Creates a pre-configured folder structure for your Express app:

    • public: Static files such as images, CSS, JS.
    • controllers: Controllers to handle route logic.
    • routes: Route definitions for different API endpoints.
    • db: Database-related files.
    • middleware: Custom middleware for the app.
    • views: Template views (if needed).
    • validations: Zod validation schemas (if opted in).
  • Generates a package.json file with the app's name and essential dependencies.

  • Generates a basic app.js file to get your server up and running.

  • Provides a simple setup process to get started quickly.

Installation

To use express-init, you can install it globally using npm:

bash

CopyEdit

npm install -g express-init

After installation, you can run the tool directly from the command line.

Usage

1. Initialize a New Express App

To create a new Express app with express-init, run the following command in your terminal:

bash

CopyEdit

express-init

The tool will prompt you for a few details:

  1. App Name: Enter the name of your Express app (e.g., my-express-app).
  2. Zod for Validation: Choose whether to use Zod for validation in your app.

Once you've answered the prompts, express-init will generate the necessary files and folder structure for your app.

2. After Initialization

Once the initialization is complete, you'll see the following message:

vbnet

CopyEdit

Your Express app has been created in /path/to/your/project Don't forget to run 'npm install' to install the dependencies.

3. Install Dependencies

Navigate to the project folder:

bash

CopyEdit

cd /path/to/your/project

Then, run the following command to install the required dependencies:

bash

CopyEdit

npm install

This will install the necessary packages defined in your package.json file.

4. Running Your Application

Once dependencies are installed, you can run your application using:

bash

CopyEdit

node app.js

Or, you can add a script to run the app more easily:

bash

CopyEdit

npm start

This will start the Express server, and you should see a message like:

arduino

CopyEdit

Server running at http://localhost:3000

Folder Structure

The following folders and files will be created:

your-app-name/ ├── app.js ├── controllers/ ├── db/ ├── middleware/ ├── public/ ├── routes/ ├── validations/ └── views/

app.js

A basic Express app configuration that includes:

  • Middleware for JSON parsing.
  • Middleware for serving static files from the public folder.
  • Placeholder for routes and controllers.

controllers/

This folder will contain the business logic for your routes. You can create separate controllers for each resource (e.g., userController.js, postController.js).

routes/

In this folder, you define your routes (e.g., userRoutes.js, authRoutes.js). Routes are linked to controllers to process requests.

db/

This folder contains files for connecting and managing your database. You can add database configuration files and models here.

middleware/

This folder contains custom middleware functions. You can add middleware for authentication, logging, error handling, etc.

public/

This folder is where static files (like images, CSS, JavaScript, etc.) are stored. Express will serve these files to the browser.

validations/

If you chose to use Zod, this folder will contain validation schemas (e.g., schema.js). You can define your validation rules for API requests here.

views/

If you want to use templates, this folder will store view files (e.g., EJS, Pug templates). It’s usually used if you're building a web app that serves HTML templates.

Configuration

The default configuration of the express-init tool creates an app with the following dependencies:

  • express: A minimal and flexible Node.js web application framework.
  • dotenv: For environment variable management.
  • inquirer: For asking user input during initialization.
  • fs-extra: A package that adds extra file system methods (like copyFile and mkdir).
  • zod (optional): A schema validation library, only if you choose to use it.

You can further customize these configurations by manually editing the package.json and adding more dependencies as needed.

Contributing

Feel free to contribute to the express-init package! To do so, follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a pull request.

Bug Reports and Issues

If you encounter any bugs or issues, please report them on the GitHub Issues page.

License

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

Acknowledgments

  • This tool was inspired by various Express.js starters and scaffolding tools.
  • Thanks to the developers of Inquirer.js for the interactive command-line prompt.

Customize the README

  • You can modify and extend the folder structure or the features as your project evolves. For example, you may choose to add additional configuration files or other features based on user feedback.
  • Don't forget to update the version number in the package.json when making updates or changes to the app.