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 🙏

© 2024 – Pkg Stats / Ryan Hefner

express-forge

v1.1.2

Published

An open-source npm package designed to streamline the process of setting up an Express.js project. It allows developers to quickly create a project skeleton with configurable options for application type, database and template engine.

Downloads

18

Readme

EXPRESS-FORGE npm version

Introduction

express-forge is an open-source npm package designed to streamline the process of setting up an Express.js project. It allows developers to quickly create a project skeleton with configurable options for application type, database and template engine.

Whether you're building a web application or an API, express-forge provides a solid foundation to get you started swiftly and efficiently.

Table of Contents

Requirements

Node v7.6.0 or higher for ES2015 and async function support.

Installation

To make the package available in the shell as standalone command, it requires a global installation:

npm install -g express-forge

Usage

The commands installs the required folder skeleton along with package.json, dependencies and an empty git repository.

Command to create an Express project:

express-forge <project_name>

Options:
    --version, -v     Show version number
    --help, -h        Show help information
    --db              Specify the database to use (choices: mysql, mongoose)                    [string]
    --app             Specify the app type (choices: web, api or both)                                  [string]
    --template        Specify the template engine to use (choices: ejs, pug, handlebars)        [string]
    --socket          Specify which socket to be implemented (choices: socket.io, websocket)    [string]

Examples:

Create a web application with MySQL as Database and Pug as template engine:

express-forge my-web-app --db=mysql --app=web --template=pug

Create an API with Mongoose as database:

express-forge my-api --db=mongoose --app=api

Create an application with both API & Web app type and implement socket.io as well:

express-forge my-api --db=mongoose --app=both --socket=socket.io

Server setup:

To start the server, from the server directory, run:

npm run dev

OR

npm run start

Folder Structure

The express-forge generates the following folder structure:

Your folder structure depends on your application type

└── PROJECT_DIRECTORY_NAME
    ├── public
    |   ├── images
    |   ├── js
    |   └── css
    |
    ├── src
    |   ├── assets
    |   |   └── css
    |   |
    |   ├── views
    |   |   ├── layouts
    |   |   ├── pages
    |   |   └── partials
    |   |
    |   ├── middlewares
    |   |   ├── auth.middleware.js
    |   |   └── error.middleware.js
    |   |
    |   ├── controllers
    |   |   ├── dashboard.controllers.js
    |   |   ├── auth.controllers.js
    |   |   └── user.controllers.js
    |   |
    |   ├── models
    |   |    ├── index.js
    |   |    └── user.js
    |   |
    |   └── routes
    |       ├── index.js
    |       ├── api.routes.js
    |       └── web.routes.js
    |
    ├── index.js
    ├── socket.js
    ├── tailwind.config.js
    ├── package.json
    ├── .sequelizerc
    ├── .prettierrc.json
    ├── .env.example
    ├── .gitignore
    └── .git

Authors

FAQs

1. What is express-forge?

express-forge is an npm package that helps you quickly set up a new Express.js project with configurable options for application type, database, and template engine.

2. How do I install express-forge?

You can install express-forge globally using npm:

npm install -g express-forge

3. How do I update express-forge?

You can update express-forge globally using npm:

npm update -g express-forge

4. What are the system requirements?

Node.js v7.6.0 or higher is required to use express-forge.

5. How do I create a new project?

Use the following command to create a new project:

express-forge <project_name> --db=<database> --app=<app_type> --template=<template_engine> --socket=<socket>

Replace , , <app_type>, , and <template_engine> with your desired values.

6. What databases are supported?

Currently, express-forge supports mysql and mongoose.

7. What application types can I create?

You can create two types of applications: web and api, you can even create the mixture of both application by passing or selecting "both" in the app type option.

8. What template engines are supported?

Currently, express-forge supports ejs, pug, and express-handlebars.

9. Which socket libraries does express-forge package integrate?

express-forge currently supports Socket.IO and WebSocket libraries.

10. How do I start the server?

Navigate to the project directory and run:

npm run dev

OR

npm run start

11. How do I start the tailwindcss compiler?

express-forge is already installed with tailwindcss and also initialized. We have already added the compiler command in the package.json file. You can start the tailwindcss compiler by navigating to the project directory and run:

npm run watch

12. Can I contribute to express-forge?

Yes, contributions are welcome! Please read the contributing guidelines (add a link to your contributing guidelines if available).

13. Where can I report issues or suggest features?

You can report issues or suggest features on the GitHub Issues page or you can join our discord channel for futher discussion.

License

MIT License