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

@boring-devs/delivery

v0.0.2

Published

an easy way of dealing with http requests

Downloads

22

Readme

Delivery

Delivery is a library for handling errors when making API requests using the axios and fetch libraries.

Installation

To install Delivery, run the following command:

npm install @boring-devs/delivery

Usage

To use Delivery in your project, first import the library:

import axios from 'axios';
import fetch from 'node-fetch';
import { fromAxios, fromFetch } from '@boring-devs/delivery';

Axios Example

You can make API requests using axios as follows:

const url = 'https://api.github.com/users/nicasiomarques';

fromAxios(axios.get(url))
  .notFound(console.log)
  .unauthorized(console.log)
  .forbidden(console.log)
  .internalServerError(console.log)
  .clientError(console.log)
  .success(console.log)
  .json((hasError, data) => {
    if (!hasError) console.log(data);
  });

Fetch Example

You can make API requests using fetch as follows:

const url = 'https://api.github.com/users/nicasiomarques';

fromFetch(fetch(url, { method: 'get' }))
  .notFound(console.log)
  .unauthorized(console.log)
  .forbidden(console.log)
  .internalServerError(console.log)
  .clientError(console.log)
  .success(console.log)
  .json((hasError, data) => {
    if (!hasError) console.log(data);
  });

Cheat Sheet

  • success(handler: TSuccess): DeliveryApi: This method takes a success handler as a parameter and sets it as a callback function to be executed when the API request is successful. The success handler can be used to process the response data and perform any necessary operations.

  • notFound(handler: TError): DeliveryApi: This method takes an error handler as a parameter and sets it as a callback function to be executed when the requested resource is not found (HTTP status code 404). The error handler can be used to display a message to the user or perform any necessary error handling.

  • unauthorized(handler: TError): DeliveryApi: This method takes an error handler as a parameter and sets it as a callback function to be executed when the user is not authorized to access the requested resource (HTTP status code 401). The error handler can be used to display a message to the user or perform any necessary error handling.

  • forbidden(handler: TError): DeliveryApi: This method takes an error handler as a parameter and sets it as a callback function to be executed when the user is forbidden from accessing the requested resource (HTTP status code 403). The error handler can be used to display a message to the user or perform any necessary error handling.

  • badRequest(handler: TError): DeliveryApi: This method takes an error handler as a parameter and sets it as a callback function to be executed when the request is invalid (HTTP status code 400). The error handler can be used to display a message to the user or perform any necessary error handling.

  • internalServerError(handler: TError): DeliveryApi: This method takes an error handler as a parameter and sets it as a callback function to be executed when an internal server error occurs (HTTP status code 500). The error handler can be used to display a message to the user or perform any necessary error handling.

  • clientError(handler: TError): DeliveryApi: This method takes an error handler as a parameter and sets it as a callback function to be executed when a client error occurs (HTTP status codes between 400 and 499). The error handler can be used to display a message to the user or perform any necessary error handling.

  • json<T>(handler: TJson<T>): void: This method takes a JSON handler as a parameter and sets it as a callback function to be executed when the API request returns a JSON response. The JSON handler can be used to process the response data and perform any necessary operations. The generic type T is used to define the type of the response data.

Contributing

If you would like to contribute to Delivery, please follow these guidelines:

  1. Fork the repository to your own Github account.
  2. Make any changes you would like to contribute.
  3. Submit a pull request with a clear description of the changes you have made.

License

This project is licensed under the MIT license.