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-buddy/core-api

v3.0.0

Published

Core API for API Buddy - A framework for building and managing APIs

Readme

@api-buddy/core-api

The foundational package of API Buddy, providing core functionality for building and managing API integrations. This package serves as the backbone for the plugin system and provides essential utilities for API operations.

🏗 Architecture Position

Core-API is the central component of API Buddy's architecture, sitting at the heart of the system and providing:

  • Core Client: The main API client interface
  • Type System: Base types and interfaces for all API operations
  • Plugin Infrastructure: Foundation for the plugin system
  • Common Utilities: Shared functionality used across all API integrations
graph TD
    A[Core-API] --> B[Plugin System]
    A --> C[API Clients]
    A --> D[Type System]
    
    B --> B1[Plugin Registration]
    B --> B2[Lifecycle Management]
    B --> B3[Dependency Resolution]
    
    C --> C1[HTTP Client]
    C --> C2[Authentication]
    C --> C3[Error Handling]
    
    D --> D1[Base Types]
    D --> D2[Validation]
    D --> D3[Type Generation]

🚀 Features

  • Type-Safe Core: Built with TypeScript for end-to-end type safety
  • Modular Design: Import only what you need
  • Plugin Ready: Extensible architecture for adding new API integrations
  • Developer Experience: Comprehensive error handling and logging
  • Modern JavaScript: Native ESM support with tree-shaking

📦 Installation

npm install @api-buddy/core-api
# or
yarn add @api-buddy/core-api
# or
pnpm add @api-buddy/core-api

🛠 Usage

Basic Setup

import { APIClient } from '@api-buddy/core-api';

// Initialize the API client
const apiClient = new APIClient({
  baseURL: 'https://api.example.com',
  // Optional: Configure default headers, timeouts, etc.
});

// Make API requests
const data = await apiClient.get('/endpoint');

With Plugin System

import { APIClient } from '@api-buddy/core-api';
import { StripePlugin } from '@api-buddy/stripe';

const client = new APIClient();

// Register plugins
client.use(new StripePlugin({
  apiKey: process.env.STRIPE_SECRET_KEY,
}));

// Use plugin functionality
const customer = await client.stripe.customers.retrieve('cus_123');

🔌 Plugin Development

Core-API provides the foundation for building plugins. Here's a basic example:

import { Plugin, APIClient } from '@api-buddy/core-api';

export class MyPlugin implements Plugin {
  name = 'my-plugin';
  
  install(client: APIClient) {
    // Add your plugin's functionality here
    client.myPlugin = {
      hello: () => 'Hello from MyPlugin!'
    };
  }
  
  // Optional: Implement lifecycle methods
  async initialize() {
    console.log('MyPlugin initialized');
  }
}

📚 API Reference

APIClient

The main client class for making API requests.

Constructor Options

| Option | Type | Description | Default | |--------|------|-------------|---------| | baseURL | string | Base URL for all requests | '' | | timeout | number | Request timeout in milliseconds | 30000 | | headers | Record<string, string> | Default headers | {} |

Methods

  • get<T>(url: string, config?: RequestConfig): Promise<T>
  • post<T>(url: string, data?: any, config?: RequestConfig): Promise<T>
  • put<T>(url: string, data?: any, config?: RequestConfig): Promise<T>
  • delete<T>(url: string, config?: RequestConfig): Promise<T>
  • use(plugin: Plugin): void - Register a plugin

🚧 Development Status

Current Features

  • [x] Base client implementation
  • [x] Type definitions
  • [x] Plugin system foundation
  • [x] Basic error handling

Upcoming Features

  • [ ] Plugin lifecycle management
  • [ ] Authentication helpers
  • [ ] Request/response interceptors
  • [ ] Caching layer

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for more details.

📄 License

MIT © API Buddy