express-pretty-listen
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

express-pretty-listen

A simple Express server runner that automatically prints the port and current package name to the terminal once the server starts.

List of parameters

  • port - Port number where the app will run
  • host (optional) - Option to overwrite the default value http://localhost
  • server - Your Express server

Getting started

Install

npm install express-pretty-listen

Use to start server

Do not use listen() method from express. Use serveExpressServer instead.

import cors from "cors";
import express from "express";
import { serveExpressServer } from "express-pretty-listen";

export const server = express() //
  .use(cors())
  .use(express.json());

serveExpressServer({ server, port: 4000 });

Output

Once you start a server script will automatically detect package name and will output table with package name and link with port to the app.

Example output when server starts:

┌─────────┬────────────────────────────┐
│ Package │ @steadysass/server-express │
├─────────┼────────────────────────────┤
│ Server  │ http://localhost:4000      │
└─────────┴────────────────────────────┘

Package Sidebar

Install

npm i express-pretty-listen

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

85.6 kB

Total Files

11

Last publish

Collaborators

  • homoky