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

pr-express-server

v0.1.1

Published

ExpressJS based server with useful middlewares

Downloads

5

Readme

pr-express-server

ExpressJS based server with useful middlewares

Philosophy

Simple and ready-to-use express-server pre-loaded with commonly used middleware provided as a starting point for development

Installation

$ npm install pr-express-server

APIs

The module exposes a simple create-function and returns an ExpressJS app with pre-loaded middleware. These middleware can be configured via options passed to the function. The app also has updated methods to start/listen and stop/close the server.

var server = require("pr-express-server");

// create server
var app = server(options);

// setup the business-login as would with an express-app
app.set(); // properties
app.use(); // handlers

// start
app.listen(callback);

// stop
app.close(callback);

Following is the list of middleware that are pre-loaded and configurable via options - you may refer to the documentation of the respective modules for options:

| Type | Option-key | Documentation | | :------- | :--------- | :------------ | | Req/Res Logger | winstonHttpLogger | express-winston | | Overload Protection | toobusy | toobusy-js | | Request ID | requestID | key: name; generator: function| | Request Logger | requestLogger | key: name; logger: logger-object | | HTTP Compression | compression | compression | | Req Body-parser | bodyParser | express-body-parser | | Security Headers | helmet | helmet | | Cookie Session | redisCookieSession | express-redis-session | | Websockets | expressWs | express-ws | | Sockets Monitoring| wsMonitor | ws-monitor | | Listening Port | port | http-port |

Refer to default options for reference at: defaults.js

Usage

Refer to test server.js implementation for usage details.

Test

$ npm install # inside pr-express-server
$ npm test