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-server-logs

v1.0.4

Published

npm module for logging in express

Readme

express-server-logs

This is an express middleware for displaying logs in the console and also logging your custom error, info, warning and success messages in console with colors for the messages.

Usage

Works like any other middleware in express

const express = require('express');
const bodyParser = require('body-parser');
const _expressLog = require('express-server-logs');

const app = express();
const log = new _expressLog();

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(log.logger);

Using with options express-server-logs takes 2 arguments one for productionMode and other is options

const log = new _expressLog(productionMode, options);

productionMode can be true or false, for true your custom messages will not display to console and for false it will.

Options here is an object

{
  date: true,
  url: true,
  method: true,
  headers: true,
  pathParam: true,
  bodyParam: true,
  queryParam: true
}

Set value of key to false if you don't want that info to be display in logs. By default productionMode is false and options have true for all keys

Example

const log = new _expressLog(true, {
                                    date: true,
                                    url: true,
                                    method: true,
                                    headers: true,
                                    pathParam: false,
                                    bodyParam: true,
                                    queryParam: true
                                  });

Using custom messages from express-server-logs

You can log your custom error messages to console using predefined messages in express-server-logs Pre defined custom messages are of type info(), success(), error(), warning()

Example

log.info('test info'); // for info color will be blue
log.success('test success'); // for success color is green
log.error('test error'); // for error color is red
log.warning('test warning'); // for warning color is yellow

Note

  • express-server-logs should be use after the body parser *
  • for productionMode = true the custom messages will not be displayed to console *