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

@quicore/expressjs

v0.2.0

Published

Provides a basic setup for an Express server with configurable options. It includes features such as cookie parsing, helmet security middleware, JSON parsing, error handling, and the ability to start both HTTP and HTTPS servers.

Readme

@quicore/expressjs

Provides a basic setup for an Express server with configurable options.
Includes cookie parsing, security headers via Helmet, JSON parsing with raw body capture, error handling, and support for starting both HTTP and HTTPS servers.


Features

  • ✅ Plug-and-play Express server setup
  • 🔒 Secure by default with Helmet
  • 🍪 Cookie parsing with cookie-parser
  • 🧾 JSON parsing with raw body access
  • 🧱 Optional view engine and proxy trust config
  • ⚡ Start HTTP and/or HTTPS server with auto-port fallback for HTTP
  • 🔧 Extendable with custom routes and middlewares
  • 🧼 Centralized error handling

Installation

npm install @quicore/expressjs

Usage

import { QuicoreExpressServer } from '@quicore/expressjs';

const config = {
  webserver: {
    http: { port: 3000 },
    https: {
      enabled: true,
      port: 3443,
      ssl: {
        key: './ssl/server.key',
        cert: './ssl/server.cert',
      },
    },
    express: {
      cookie: true,
      helmet: true,
      urlencodedExtended: true,
      views: {
        path: './views',
        engine: 'ejs',
      },
      proxy: {
        trust: true,
      },
    },
  },
};

const server = new QuicoreExpressServer(config);

// Optional: Add custom middleware
server.use((req, res, next) => {
  console.log(`[${req.method}] ${req.url}`);
  next();
});

// Optional: Add routes
server.setRoutes([
  {
    type: 'get',
    path: '/',
    handlers: (req, res) => res.send('Hello from Quicore Express Server!'),
  },
]);

// Start both HTTP and HTTPS servers
server.initializeCommonMiddlewares();
server.startServer();

API

Constructor

new QuicoreExpressServer(config?: object)
  • config.webserver.http.port: Port for HTTP server (default: 3000)
  • config.webserver.https: Configuration for HTTPS server
  • config.express: Express middleware settings

Methods

| Method | Description | | ---------------------------------------------- | ---------------------------------------------------------------------------- | | initializeCommonMiddlewares() | Sets up JSON, URL-encoded, text, raw, cookie-parser, helmet, and view engine | | use(...middlewares) | Adds middleware(s) to the app | | setRoutes(routes) | Sets up defined route handlers | | startHTTP() | Starts an HTTP server with fallback if port is in use | | startHTTPS() | Starts an HTTPS server with SSL settings | | startServer() | Calls both startHTTP() and startHTTPS(), and sets the error handler | | setAdditionalSupportedContents(contentTypes) | Adds custom content types to parse as raw text |


Error Handling

All errors are logged with context (path, IP, headers, etc.) and return a structured JSON error response:

{
  "error": "server_error",
  "error_description": "Internal Server Error"
}

License

MIT