🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@eric8810/catcher-core

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eric8810/catcher-core

Catcher shared type definitions — zero runtime dependencies

latest
npmnpm
Version
0.3.16
Version published
Maintainers
1
Created
Source

@eric8810/catcher-core

npm version License: MIT

Shared TypeScript type definitions for the catcher toolkit. Zero runtime dependencies.

This package is consumed by @eric8810/catcher-http, @eric8810/catcher-ws, and @eric8810/catcher-web. You typically don't install it directly.

💡 Node.js users: For Rust-native performance, use @eric8810/catcher-napi-http and @eric8810/catcher-napi-ws instead. They provide typed TS wrappers with the same config schema and much better throughput.

Install

npm install @eric8810/catcher-core

Exported Types

HTTP

TypeDescription
IHttpClientHTTP client interface (get, post, put, delete, patch)
HttpClientConfigClient configuration
RequestConfigPer-request options
HttpResponseResponse shape
ProgressEventUpload/download progress
InterceptorManagerRequest/response interceptor API

Error

TypeDescription
CatcherHttpErrorEnhanced error with type, request, response, attempt info
CatcherErrorType'connection' | 'timeout' | 'http' | 'cancelled' | 'unknown'
isCatcherError()Type guard for CatcherHttpError

Network

TypeDescription
ProxyConfigHTTP/HTTPS proxy settings
DnsConfigDNS resolution options
TlsConfigTLS/SSL settings
RedirectInfoRedirect policy
TransportAdapterCustom transport adapter

SSE

TypeDescription
SSEStreamAsyncIterable SSE line stream
SSEClientLong-lived SSE connection with auto-reconnect
SSEStreamOptionsStream configuration
SSEClientOptionsClient configuration
SSETimeoutErrorTimeout error type

Events

TypeDescription
ClientEventEvent payload types (requestComplete, retry, etc.)

Usage

import type { IHttpClient, HttpClientConfig, CatcherHttpError } from '@eric8810/catcher-core'
import { isCatcherError } from '@eric8810/catcher-core'

try {
  const data = await client.get('/api/data')
} catch (err) {
  if (isCatcherError(err)) {
    console.log(err.type, err.attempt, err.elapsedMs)
  }
}

License

MIT

FAQs

Package last updated on 14 Jun 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts