Lightning-fast TypeScript utilities for modern development
npm install bytekit> Previously known as: @sebamar88/utils (v0.1.9 and earlier)
EN: Modern TypeScript utilities: an isomorphic ApiClient, structured logging/profiling helpers, and ready-to-use modules (DateUtils, StringUtils, StorageManager, etc.).
ES: Colección moderna de utilidades TypeScript: ApiClient isomórfico, logging/profiling estructurado y helpers listos (DateUtils, StringUtils, StorageManager, etc.).










---
- ✅ EN: Fully ESM with .d.ts definitions and tree-shakeable exports. ES: Build 100% ESM con tipos listos y exports tree-shakeable.
- 🌐 EN: Works on Node.js 18+ and modern browsers (native fetch). ES: Compatible con Node.js 18+ y navegadores modernos (fetch nativo).
- 🔁 EN: ApiClient with retries, circuit breaker, localized errors, and flexible options. ES: ApiClient con reintentos, circuit breaker, errores localizados y configuración flexible.
- 🧩 EN: 28 helper modules (strings, dates, validators, env, storage, crypto, cache). ES: 28 módulos helpers (strings, fechas, validadores, env, storage, crypto, cache).
- 🪵 EN: Structured logging/profiling: createLogger, Profiler, withTiming. ES: Logging/profiling estructurado: createLogger, Profiler, withTiming.
- 🎯 EN: 95%+ test coverage with comprehensive test suite. ES: >95% de cobertura de tests con suite completa.
- 📦 EN: True zero dependencies (uses native fetch). ES: Verdadero zero dependencies (usa fetch nativo).
- ⚡ EN: Optimized for performance and small bundle size. ES: Optimizado para rendimiento y tamaño mínimo.
``bash`
npm install bytekitor / o
pnpm add bytekitor / o
yarn add bytekit
`bash`
npm install -g bytekitThen use / Luego usa:
sutils create users
sutils types https://api.example.com/users
`ts
import { ApiClient, createLogger, DateUtils, StringUtils } from "bytekit";
const http = new ApiClient({
baseUrl: "https://api.my-service.com",
defaultHeaders: { "X-Team": "@sebamar88" },
locale: "es",
errorMessages: {
es: { 418: "Soy una tetera ☕" },
},
});
const users = await http.get<{ id: string; name: string }[]>("/users");
const logger = createLogger({ namespace: "users-service", level: "info" });
logger.info("Users synced", { count: users.length });
const slug = StringUtils.slugify("New Users – October 2024");
`
`ts
// Import specific modules to reduce bundle size
// Importa módulos específicos para reducir el tamaño del bundle
// Core modules / Módulos core
import { ApiClient } from "bytekit/api-client";
import { Logger } from "bytekit/logger";
import { RetryPolicy } from "bytekit/retry-policy";
// Helper modules / Módulos helpers
import { DateUtils } from "bytekit/date-utils";
import { StringUtils } from "bytekit/string-utils";
import { ArrayUtils } from "bytekit/array-utils";
`
EN: Works seamlessly with React, Vue, Svelte, Angular, Next.js, Nuxt, SvelteKit, and more.
ES: Funciona perfectamente con React, Vue, Svelte, Angular, Next.js, Nuxt, SvelteKit y más.
`jsx
import { createApiClient } from "bytekit";
import { useState, useEffect } from "react";
function Users() {
const client = createApiClient({ baseURL: "https://api.example.com" });
const [users, setUsers] = useState([]);
useEffect(() => {
client.get("/users").then(setUsers);
}, [client]);
return (
📖 View More Framework Examples →
📚 Complete Documentation / Documentación Completa
EN: For detailed documentation of all 28 modules, visit our comprehensive GitHub Wiki.
ES: Para documentación detallada de todos los 28 módulos, visita nuestra GitHub Wiki completa.
$3
#### 🔧 Core Modules (9) - Essential functionality / Funcionalidad esencial
- ApiClient - Typed HTTP client with retries, localized errors, and custom fetch support
- Logger - Structured logger with levels, namespaces, and transports for Node/browser
- Profiler - Profiler utilities and helpers
- RetryPolicy - RetryPolicy utilities and helpers
- ResponseValidator - ResponseValidator utilities and helpers
- RequestCache - RequestCache utilities and helpers
- RateLimiter - RateLimiter utilities and helpers
- RequestDeduplicator - RequestDeduplicator utilities and helpers
- ErrorBoundary - ErrorBoundary utilities and helpers
#### 🛠️ Helper Modules (12) - Common utilities / Utilidades comunes
- DateUtils - Safe date parsing, manipulation, and formatting utilities
- StringUtils - Text processing utilities: slugify, capitalize, mask, interpolate
- Validator - Validation utilities for emails, phones, passwords, and more
- EnvManager - EnvManager utilities and helpers
- StorageUtils - StorageUtils utilities and helpers
- FileUploadHelper - FileUploadHelper utilities and helpers
- StreamingHelper - StreamingHelper utilities and helpers
- WebSocketHelper - WebSocketHelper utilities and helpers
- ArrayUtils - Array manipulation utilities: chunk, flatten, unique, shuffle, zip
- ObjectUtils - Object manipulation utilities: merge, pick, omit, flatten, groupBy
- FormUtils - FormUtils utilities and helpers
- TimeUtils - TimeUtils utilities and helpers
#### ⚡ Utility Modules (7) - Advanced features / Características avanzadas
- EventEmitter - EventEmitter utilities and helpers
- DiffUtils - DiffUtils utilities and helpers
- PollingHelper - PollingHelper utilities and helpers
- CryptoUtils - Token/UUID generation, base64 encoding, hashing, and HMAC
- PaginationHelper - PaginationHelper utilities and helpers
- CacheManager - Multi-tier cache with TTL, LRU eviction, and statistics
- CompressionUtils - CompressionUtils utilities and helpers
🌟 Popular Use Cases / Casos de Uso Populares
$3
`ts
const api = new ApiClient({
baseUrl: "https://api.example.com",
retryPolicy: { maxAttempts: 3, initialDelayMs: 100 },
circuitBreaker: { failureThreshold: 5 },
});const users = await api.get("/users");
`$3
`ts
const logger = createLogger({ namespace: "app", level: "info" });
logger.info("User created", { userId: 123, email: "user@example.com" });
`$3
`ts
const formatted = DateUtils.format(new Date(), "es-AR");
const slug = StringUtils.slugify("Hello World! 🌍");
const masked = StringUtils.mask("1234567890", { start: 4, end: 2 });
`$3
`ts
const chunks = ArrayUtils.chunk([1, 2, 3, 4, 5], 2); // [[1,2], [3,4], [5]]
const picked = ObjectUtils.pick(user, ["id", "name", "email"]);
const grouped = ObjectUtils.groupBy(users, "department");
``EN: Try bytekit in your browser with these interactive examples:
ES: Prueba bytekit en tu navegador con estos ejemplos interactivos:
- React Example - Complete React app with ApiClient
- Vue Example - Vue 3 composition API usage
- Svelte Example - Svelte integration example
EN: Comprehensive guides to help you get the most out of bytekit:
ES: Guías completas para aprovechar al máximo bytekit:
- 🚀 Getting Started - Installation, basic usage, and core concepts / Instalación, uso básico y conceptos core
- 🔬 Advanced Usage - Complex patterns and techniques / Patrones y técnicas complejas
- ✨ Best Practices - Production-ready patterns / Patrones para producción
- 📖 Examples & Snippets - Code samples and interactive demos / Ejemplos de código y demos interactivos
- React Basic - ApiClient with React hooks / ApiClient con hooks de React
- Vue Basic - Composition API integration / Integración con Composition API
- Svelte Basic - Svelte stores integration / Integración con stores de Svelte
- 📦 NPM Package - Install and version info
- 📚 Full Documentation Wiki - Complete API reference
- 🚀 Live Examples - Working code samples
- 📋 Issues & Support - Bug reports and feature requests
- 🔄 Changelog - Version history
EN: Contributions are welcome! Please read our contributing guidelines and feel free to submit issues and pull requests.
ES: ¡Las contribuciones son bienvenidas! Lee nuestras guías de contribución y no dudes en enviar issues y pull requests.
MIT © Sebastián Martinez
---
💡 Need help? Check the Wiki or open an issue.