Package Exports
- @daiso-tech/core/async
- @daiso-tech/core/cache
- @daiso-tech/core/cache/adapters
- @daiso-tech/core/cache/contracts
- @daiso-tech/core/cache/test-utilities
- @daiso-tech/core/collection
- @daiso-tech/core/collection/contracts
- @daiso-tech/core/event-bus
- @daiso-tech/core/event-bus/adapters
- @daiso-tech/core/event-bus/contracts
- @daiso-tech/core/event-bus/test-utilities
- @daiso-tech/core/lock
- @daiso-tech/core/lock/adapters
- @daiso-tech/core/lock/contracts
- @daiso-tech/core/lock/test-utilities
- @daiso-tech/core/serde
- @daiso-tech/core/serde/adapters
- @daiso-tech/core/serde/contracts
- @daiso-tech/core/serde/test-utilities
- @daiso-tech/core/utilities
Readme
@daiso-tech/core
A modular, framework-agnostic library providing essential components for modern web applications. Stop reinventing the wheel - focus on building your application while the library handles the core functionalities.
✨ Features
Current Features
Immutable Collections:
IterableCollection
- Simplifies work withIterable
ListCollection
- Simplifies work withArray
AsyncIterableCollection
- Simplifies work withAsyncIterable
Middleware System
- Agnostic middlewares applicable to any async/sync functions.
fallback
: Automatic recovery with default values on errorsobserve
: Monitor function execution and performanceretry
: Smart retries with multiple backoff policies:constantBackoffPolicy
exponentialBackoffPolicy
linearBackoffPolicy
polynomialBackoffPolicy
sequentialHedging
: Runs fallbacks sequentially if the primary function fails, ensuring graceful failure handling.concurrentHedging
: Executes the primary function alongside fallbacks concurrently, returning the first successful result and aborting all remaining operations.timeout
: Guaranteed execution time limits
- Agnostic middlewares applicable to any async/sync functions.
LazyPromise:
- Executes only when awaited
- With middleware support
Pluggable Components:
Cache
with adapter supportLock
with adapter supportEventBus
with adapter supportSerde
(serializer, deserializer) adapters
Planned Features
- Query bus
- Command bus
- Semaphore component
- SharedLock (ReaderWriterLock)
- RateLimiter
- CircuitBreaker
- MessageQueue
- TaskScheduler
- Notification system
- Abstract file system
🚀 Installation
npm install @daiso-tech/core
Inspired By
Built with ideas from:
- Laravel, PHP
- Symfony components, PHP
- Verrou, TypeScript
- Distributed lock, C#
- Bento cache, TypeScript
- Fusion cache, C#
- Polly, C#