Socket
Book a DemoInstallSign in
Socket

express-pretty-listen

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-pretty-listen

Simple express server runner that will print out automatically port and current package name in the terminal once the server is started.

1.0.1
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

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      │
└─────────┴────────────────────────────┘

Keywords

express

FAQs

Package last updated on 28 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.