New:Socket for Asana Is Now Available.Learn more
Get Started

@eric8810/catcher-core

Package Overview
Dependencies
Maintainers
1
Versions
22
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

npmnpm
Version
0.3.11
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 01 Jun 2026

Related posts