Package shape
ByteKit is organized as a small set of public entrypoints. Each one maps to a focused area of responsibility.Core entrypoints
ByteKit exposes a small set of focused entrypoints instead of one large monolith.Networking and resilience
bytekit: convenience root export for the main modulesbytekit/api-client:ApiClient,ApiError, request types, list helpersbytekit/retry-policy:RetryPolicyandCircuitBreakerbytekit/response-validator: built-in validation utilitiesbytekit/request-cache: in-memory request cache primitivesbytekit/request-deduplicator: deduplicate in-flight requestsbytekit/rate-limiter: token bucket and sliding-window rate limitingbytekit/error-boundary: normalize and isolate errorsbytekit/schema-adapter: schema adapter helpers likezodAdapterandvalibotAdapter
Async toolkit
bytekit/async:retry,parallel,sequential,race,allSettled,timeout,sleep,debounceAsync,throttleAsync
Observability
bytekit/logger: structured logs and logger factory helpersbytekit/profiler: execution timing and performance measurementbytekit/debug: debug helpers for development diagnostics
Helpers
bytekit/env-manager: environment-aware value lookupbytekit/storage-utils: storage access helpersbytekit/file-upload: multipart and upload helpersbytekit/streaming: NDJSON, SSE, and streaming downloadsbytekit/websocket: typed WebSocket helper utilitiesbytekit/cache-manager: broader cache strategies beyond request cachingbytekit/compression-utils: compression and decompression helpersbytekit/crypto-utils: hashes, HMAC, UUIDs, and secure comparisonsbytekit/diff-utils: object and array diffingbytekit/event-emitter: event bus primitivesbytekit/polling-helper: polling with configurable intervals and control
Choose by use case
| If you need to… | Use |
|---|---|
| Call REST endpoints with typed helpers | ApiClient |
| Retry flaky async code outside HTTP | bytekit/async retry |
| Protect an unstable integration | RetryPolicy, CircuitBreaker, RateLimiter |
| Avoid duplicate in-flight calls | RequestDeduplicator |
| Cache request results locally | RequestCache or CacheManager |
| Consume event streams or NDJSON | StreamingHelper |
| Standardize logs across modules | Logger or createLogger |
Recommended import style
Use the narrowest public entrypoint that matches your use case.bytekit also re-exports the main modules.
Good defaults
- Prefer
bytekit/api-clientandbytekit/asyncin application code when you want explicit module boundaries. - Prefer the root
bytekitexport in quick prototypes or small services. - Keep user-facing docs and examples on public package exports only.