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

api-hub-client

v1.0.0

Published

This is a API Hub client for the API routes

Readme


Overview

api-hub-client provides a developer-friendly TypeScript interface to interact with the api-hub server.
It simplifies API calls by handling requests, responses, and type definitions automatically, enabling type-safe and maintainable integration in frontend or Node.js applications.


Features

  • Fully typed TypeScript API for IntelliSense and compile-time safety
  • Async/await interface for all requests
  • Supports all endpoints exposed by the api-hub server
  • Easy configuration with baseUrl
  • Handles errors and responses consistently

Supported API Endpoints

| Module | Endpoint | Description | Example Method | |------------|----------|------------|----------------| | GitHub | /github/repos/:username | Fetch GitHub repositories for a given username | client.github.getRepos(username) | | YouTube | /youtube/search/:query | Search YouTube videos by query | client.youtube.search(query) | | TheMealDB | /mealdb/search/:query | Search for meals and recipes | client.mealdb.search(query) | | NewsAPI | /newsapi/top-headlines | Fetch latest news articles | client.newsapi.topHeadlines(country) | | Weather | /weather/current/:city | Get current weather info for a city | client.weather.getCurrent(city) |

Click the module name to view the corresponding backend route implementation.


Project Structure

api-hub-client/
├── src/
│   ├── index.ts         # Entry point exporting ApiHubClient class
│   ├── client.ts        # HTTP client implementation
│   └── types/           # TypeScript types for requests and responses
├── package.json
├── tsconfig.json
├── README.md
└── .env.example

Prerequisites

  • Node.js v18 or later
  • npm, yarn, or pnpm
  • Access to a running api-hub server

Installation

Install the package in your project:

npm install api-hub-client
# or
yarn add api-hub-client

Configuration

Create an instance of the client with your API Hub server base URL:

import { ApiHubClient } from "api-hub-client";

const client = new ApiHubClient({
  baseUrl: "http://localhost:8080",
});

Usage Examples

Fetch GitHub Repositories

const repos = await client.github.getRepos("facebook");
console.log(repos);

Search TheMealDB

const recipes = await client.mealdb.search("carbonara");
console.log(recipes);

Search YouTube

const videos = await client.youtube.search("nextjs tutorial");
console.log(videos);

TypeScript Support

Provides types for:

  • Request parameters
  • API responses
  • Error handling
  • Optional pagination helpers

This ensures full IntelliSense and compile-time safety.


Development

cd api-hub-client
npm install
npm run build

Link the client locally for testing:

npm link

Ensure the api-hub server is running for real-time testing.


Scripts

| Command | Description | | --------------- | --------------------------------- | | npm run dev | Start development with watch mode | | npm run build | Compile TypeScript to JavaScript | | npm test | Run unit tests (if available) |


Contributing

This package follows the monorepo contribution guidelines.

Please review CONTRIBUTING.md before submitting a pull request.


License

MIT