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

@rapid.io/core

v1.0.0

Published

rapid.io is a library that builds performant, scalable APIs from smaller building blocks

Downloads

7

Readme

RAPID.IO

Making Back End development faster, much more scalable, easier and with the least amount of boilerplate code.

Contents

Core Concepts

The Chain

Set of Blocks connected together horizontally and vertically to form a bigger structure which is the API.

For example, the diagram image below is a basic chain constructing an API with the following features:

  1. Increase a counter by +1 by inserting a new document into the database containing user's name and date of insertion.
  2. Count the documents inserted.
  3. Log each count into the console or logfile using a Logger util which can be a wrapper for winston or native console.
  4. Handle errors

diagram

Each reactangle is a Block.

Blocks

Rapid.io is more similar to React than Angular and NestJS in that it does not provide any built-in Blocks or implement any helpers like the HTTP client in Angular or Pipes in NestJS. You can create a Block to wrap an external library and inject it into another Block.

Features:

  • Blocks are pieces of code designed to be chained together to form a bigger structure called The Chain.
  • Each block is a node module and has its own package.json.
  • Each block is instantiated one or more times with a different Injection Token each time.
  • Each block can be injected to any other block and has its own unique Injection Token which can be manually set for simplicity.

Blocks may communicate with each other

Blocks can be injected into other Blocks classes, for example:

An authentication middleware may inject a User Model to lookup the user and validate privilages.

Another example:

Book model may come with a swagger definition.

{
  "definitions": {
    "Book: {
      "type": "object",
      "properties": {
        "name": {
          type: "string"
        },
        "author": {
          "$ref": "#/definitions/User"
        }
      }
    }
  }
}

Blocks may be used multiple times with different variables

Blocks are the most fundmental building block of The Chain and one block can be used multiple times with different configurations, for example:

A validation middleware block may be used to build different endpoints and configured with different models.

All block injections are optional

If the injector was not able to find the target block, the main block must implement a way to gracefully handle the missing dependency.

Four Principles

Endpoints

The Chain's last building block is an endpoint. An endpoint can be designed to do many things. Example endpoints:

  • Create
  • Read
  • Update
  • Delete
  • Paginate

Middlewares

Endpoints can have multiple parents of type Middleware back in The Chain. Example middlewares:

  • Body validation
  • Error handling
  • Authentication

Models

Models are data schemas:

  • Control the data stored in the database.
  • Generate schemas to be used for request body validation.
  • Serialize data for response

    e.g. Removing password from user object

Utils

Basically, utils are wrappers for external libraries like: winston, express, swagger or cors.