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

chapybara

v0.6.0

Published

Official NodeJS SDK for the Chapybara Domain & IP Intelligence API.

Readme

Chapybara NodeJS SDK

The official NodeJS SDK for the Chapybara Domain & IP Intelligence API.

Features

  • Fluent, Promise-based API: Modern and easy to use with async/await.
  • Automatic Retries: Automatically retries failed requests on server errors (5xx) with exponential backoff.
  • Configurable Caching: Built-in LRU caching to reduce latency and save on API quotas.
  • TypeScript Support: Ships with detailed type definitions for a superior developer experience.
  • Custom Error Handling: Throws specific error types for robust error management.

Installation

npm install chapybara

Usage

First, import and instantiate the client with your API key.

import { ChapybaraClient } from "chapybara";

const chapybara = new ChapybaraClient({
  apiKey: "ck_your_api_key_here",
});

Get Your IP Address

async function getUserIP() {
  try {
    const data = await chapybara.getUserIP();
    console.log(data.ip);
  } catch (error) {
    console.error(`Error fetching user IP: ${error.message}`);
  }
}

getUserIP();

Get Domain Intelligence

async function getDomainInfo() {
  try {
    const data = await chapybara.domain.getIntelligence("google.com");
    console.log(data.domain_identity);
    console.log(data.security_analysis);
  } catch (error) {
    console.error(`Error fetching domain data: ${error.message}`);
  }
}

getDomainInfo();

Get IP Intelligence

async function getIpInfo() {
  try {
    const data = await chapybara.ip.getIntelligence("8.8.8.8");
    console.log(data.location.country.name);
    console.log(data.network.organization);
  } catch (error) {
    console.error(`Error fetching IP data: ${error.message}`);
  }
}

getIpInfo();

Get Web Tech Data

async function getWebTechInfo() {
  try {
    const data = await chapybara.webtech.getScanner("github.com");
    console.log(data.title);
    console.log(data.technologies);
  } catch (error) {
    console.error(`Error fetching web tech data: ${error.message}`);
  }
}

getWebTechInfo();

Get Account Information

async function getAccountDetails() {
  try {
    const data = await chapybara.account.getInfo();
    console.log("Domain quota remaining:", data.quotas.domain.remaining);
  } catch (error) {
    console.error(`Error fetching account info: ${error.message}`);
  }
}

getAccountDetails();

Configuration

You can pass a configuration object to the ChapybaraClient constructor:

const chapybara = new ChapybaraClient({
  apiKey: "ck_your_api_key_here",
  baseUrl: "https://api.chapyapi.com/api/v1", // Optional: override base URL
  retries: 2, // Optional: number of retries on server errors (default: 2)
  timeout: 30000, // Optional: request timeout in ms (default: 30000)
  cacheOptions: {
    // Optional: LRU cache options
    max: 500, // Max number of items in cache
    ttl: 1000 * 60 * 5, // Cache TTL in ms (5 minutes)
  },
});

Error Handling

The SDK throws custom errors for different API responses, allowing you to handle them gracefully. All errors extend ChapybaraError.

  • AuthenticationError: Invalid or missing API key (401, 403).
  • RateLimitError: Rate limit exceeded (429).
  • NotFoundError: Resource not found (404).
  • BadRequestError: Invalid input (400, 402).
  • ServerError: An error occurred on the Chapybara servers (5xx).
  • APIError: A generic API error.
import { RateLimitError, AuthenticationError } from "chapybara";

async function handleErrors() {
  try {
    await chapybara.domain.getIntelligence("invalid-domain");
  } catch (error) {
    if (error instanceof RateLimitError) {
      console.log("Rate limit hit. Please wait before trying again.");
    } else if (error instanceof AuthenticationError) {
      console.log("Authentication failed. Please check your API key.");
    } else {
      console.log(`An API error occurred: ${error.message}`);
      console.log(`Request ID: ${error.requestId}`);
    }
  }
}