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 🙏

© 2025 – Pkg Stats / Ryan Hefner

expressico

v0.4.0

Published

`Expressico` is a Express.JS bootstrapper, it includes a versitile configuration that is simple and easy to use. This bootstrap package will help keep your codebase clean and modular for those pesky microservices that you keep copying the same code over a

Readme

Expressico! Build npm version

Expressico is a Express.JS bootstrapper, it includes a versitile configuration that is simple and easy to use. This bootstrap package will help keep your codebase clean and modular for those pesky microservices that you keep copying the same code over and over again.

Contributing & Development

Getting Started

Installation

# NPM
npm install expressico@latest
# YARN
yarn add expressico@latest

Basic Server Script

import expressico, { defineConfig, defineController, defineMiddleware } from "expressico";

const actuator = defineController({
  path: "/api/actuator"
});

actuator.add({
  path: "/alive",
  handler: (r, response) => {
    response.ok("YES");
  }
});

const customMiddleware = defineMiddleware({
  name: "customMiddleware"
  handler: (request, response, next) => {
    console.log(request.hostname)
    next();
  }
});

const config = defineConfig({
  debug: true,
  controllers: [ actuator ],
  middleware: [ customMiddleware ]
});

expressico.start(config);

Yes, its that simple.


Breakdown

Localhost development

By default, while developing locally Expressico will allow all CORS to pass through your development server.

HTTPS

By default, Expressico enforces any route to HTTPS, rather than HTTP.

To disable this:

const config = defineConfig({
  enforceHttps: false
})

JSON Body Parser

By default Expressico enables the use of req.body and parses it as JSON.

Compression

By default Expressico compresses the outgoing responses for quicker performance.

For more info see the compression package.

Helpful response functions

Expressico automatically creates some helpful response functions, for instance, in your controller you can:

controller.add({
  path: "/:id"
  handler: (req, res) => {
    const { id } = req.params;
    if(id) {
      res.ok({ SUCCESS: "The ID was successfully found and this 'ok' function returns this message and a status of 200" });
    } else {
      res.fail(400, "Bad request, the ID was not provided and this 'fail' function returns an error message and the provided status code of 400");
    }
  }
})

Controller API

Defining the controller

import { defineController } from "expressico";
const controller = defineController({
  path: "/api" // all routes added to this controller will be prefixed with "/api"
})

Adding routes to the controller

import { defineController } from "expressico";
const controller = defineController({ path: "/api" });
controller.add({
  path: "/my-custom-route" // will resolve to "/api/my-custom-route"
  method: "GET" // "GET" is the default method, this field is optional
  before: [] // these are extra RequestHandlers that are executed *before* the main handler is called.
             // This is especially usefull for handling auth or other error handling scenarios

  handler: (r, response) => { // Your main handler for this route and will be the final response after all the before handlers are called.
    response.ok({ "OK": "everything seems good" });
  }
})

You can call the .add function as many times as you want as long as you export the controller definition.

import { defineController } from "expressico";
const controller = defineController({ path: "/api" });
controller.add({ path: "/v1", handler: (r, response) => {
  response.ok({})
}});
controller.add({ path: "/v2", handler: (r, response) => {
  response.ok({})
}});
// you can also pass a spread array to the .add function...
controller.add(
  {
    path: "/v3", handler: (r, response) => {
      response.ok({})
    }
  },
  {
    path: "/v4", handler: (r, response) => {
      response.ok({})
    }
  }
);