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

new-express-app

v1.4.1

Published

NPM package to create new pre-configured express app for REST API's from the command line

Readme

new-express-app

npm bundle size npm GitHub issues NPM GitHub package.json version npm

NPM package to create new pre-configured express app for REST API's from the command line. Download

🎉 What's new?

V 1.3.0

(July 16, 2020) Now, you can choose a package manager npm or yar. 💖

V 1.2.0

(July 15, 2020) Now, you can choose between JavaScript with EsLint setup and TypeScript with TsLint setup. 🎉🎆

📥 Installation

install the package globally with this command.

npm i -g new-express-app

⚙️ Usage

Run this command where you want to create the new app.

npx new-express-app

then answer the following Questions to configure your project:

? Enter Project Name:
? Enter version:
? Enter description:
? Enter author name:
? what language you want to use? # JavaScript or TypeScript
? choose a package Manager: # npm or yarn
? Want to initialise git?
? Want to install dotEnv?
? Want to install database driver? # MongoDB, Mongoose or None
? Want to initialise EsLint/Prettier? # if you chose JavaScript
? Want to initialise TsLint/Prettier? # if you chose TypeScript

🛠 Installed dependencies

Default Dependencies with JavaScript Setup

  • Express
  • cors

Default Dependencies with TypeScript Setup

  • Express
  • cors
  • typescript
  • ts-node

Optinal Dependencies

  • dotenv
  • mongoDB
  • assert
  • mongoose

Default devDependencies with JavaScript Setup

  • nodemon

Default devDependencies with TypeScript Setup

  • nodemon
  • @types/node
  • @types/express
  • @types/cors

Optinal devDependencies

  • EsLint / TsLint
  • prettier
  • required devDependencies for the past two devDependencies.
  • @types/mongoose
  • @types/mongodb
  • @types/assert

📁 Folder structure

JavaScript Setup

.
├── .env
├── .eslintrc.json
├── .gitignore
├── package-lock.json
├── package.json
├── prettier.config.js
└── src
    ├── controllers
    │   └── controller.js
    ├── index.js
    ├── models
    └── routes
        └── router.js

4 directories, 9 files

TypeScript Setup

.
├── .env
├── .gitignore
├── .prettierrc.json
├── package-lock.json
├── package.json
├── src
│   ├── controllers
│   │   └── controller.ts
│   ├── index.ts
│   ├── models
│   └── routes
│       └── router.ts
├── tsconfig.json
└── tslint.json

4 directories, 10 files

📄 Files Content

index.js

const express = require('express');
const cors = require('cors');

const router = require('./routes/router');

const app = express();

app.use(express.urlencoded());
app.use(express.json());

app.use(cors({ origin: true, credentials: true }));

app.use('/', router);

app.listen(8080, () => {
  console.log('Server Running');
});

router.js

const express = require('express');
const Controller = require('../controllers/controller');

const router = express.Router();

router.use('/', Controller.helloWorld);

module.exports = router;

controller.js

exports.helloWorld = (req, res, next) => {
  res.send('<h1>Hello World!</h1>');
};

.eslintrc.json

{
  "env": {
    "node": true,
    "commonjs": true,
    "es2020": true
  },
  "extends": ["plugin:prettier/recommended", "airbnb-base"],
  "parserOptions": {
    "ecmaVersion": 11
  },
  "rules": {
    "prettier/prettier": "error"
  },
  "plugins": ["prettier"]
}

prettier.config.js

module.exports = {
  tabWidth: 2,
  semi: true,
  singleQuote: true,
  trailingComma: 'es5',
};

🦾 Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

⚖ License

Copyright 2020 Mahmoud .A Mahmoud. Licensed under the MIT License