@bluelibs/runner - v5.5.0
    Preparing search index...

      @bluelibs/runner - v5.5.0

      BlueLibs Runner

      A TypeScript-first dependency injection framework that combines functional programming with enterprise features. No decorators, no magic - just explicit, testable code.

      import { r, run } from "@bluelibs/runner";

      // Define a task (a function with superpowers)
      const greet = r.task("greet")
      .run(async (name: string) => `Hello, ${name}!`)
      .build();

      // Create and run your app
      const app = r.resource("app").register([greet]).build();
      const { runTask } = await run(app);

      console.log(await runTask(greet, "World")); // "Hello, World!"
      • Tasks: Functions with dependency injection, middleware, and validation
      • Resources: Singleton services with lifecycle management (init/dispose)
      • Events: Type-safe messages for decoupled communication
      • Hooks: Lightweight event handlers
      • Middleware: Cross-cutting concerns (auth, logging, caching)

      Namespaces

      definitions
      Errors

      Enumerations

      CircuitBreakerState
      CronOnError
      HookDependencyState
      ResourceInitMode
      RunnerMode
      SymbolPolicyErrorMessage

      Classes

      EventManager
      LockableMap
      Logger
      LogPrinter
      MiddlewareManager
      PlatformAdapter
      Queue
      RunnerError
      RunResult
      Semaphore
      Serializer
      Store
      TaskRunner

      Interfaces

      AsyncContextFluentBuilder
      CacheResourceConfig
      CircuitBreakerMiddlewareConfig
      CircuitBreakerOpenError
      CircuitBreakerStatus
      ConcurrencyMiddlewareConfig
      ConcurrencyState
      CronResourceValue
      CronScheduledTask
      CronTagConfig
      DebounceState
      DeserializationContext
      ErrorFluentBuilder
      EventFluentBuilder
      ExecutionJournal
      ExposureFetchAuthConfig
      ExposureFetchClient
      ExposureFetchConfig
      FallbackMiddlewareConfig
      HookFluentBuilder
      HookOverrideBuilder
      HttpClient
      HttpClientAuth
      HttpClientAuthConfig
      HttpClientConfig
      HttpClientFactoryConfig
      HttpCreateClientConfig
      IAsyncContext
      IAsyncContextDefinition
      IAsyncContextMeta
      IAsyncLocalStorage
      ICacheInstance
      IContractable
      IErrorDefinition
      IErrorDefinitionFinal
      IErrorHelper
      IErrorMeta
      IEvent
      IEventDefinition
      IEventEmission
      IEventEmitOptions
      IEventEmitReport
      IEventHandlerOptions
      IEventListenerError
      IEventMeta
      IHook
      IHookDefinition
      ILog
      ILogInfo
      IMeta
      IMiddlewareMeta
      InputFile
      InputFileMeta
      IOptionalDependency
      IPlatformAdapter
      IResource
      IResourceDefinition
      IResourceMeta
      IResourceMiddleware
      IResourceMiddlewareConfigured
      IResourceMiddlewareDefinition
      IResourceMiddlewareExecutionInput
      IResourceWithConfig
      IRunnerError
      IRuntime
      ITag
      ITagConfigured
      ITagDefinition
      ITaggable
      ITagMeta
      ITask
      ITaskDefinition
      ITaskMeta
      ITaskMiddleware
      ITaskMiddlewareConfigured
      ITaskMiddlewareDefinition
      ITaskMiddlewareExecutionInput
      IValidationSchema
      JournalSetOptions
      ObjectReference
      OnUnhandledErrorInfo
      PhantomTaskFluentBuilder
      PrintableLog
      RateLimitError
      RateLimitMiddlewareConfig
      RateLimitState
      RequireContextMiddlewareConfig
      ResourceFluentBuilder
      ResourceForkInfo
      ResourceForkOptions
      ResourceMiddlewareFluentBuilder
      RetryMiddlewareConfig
      RunnerFileSentinel
      SerializationContext
      SerializedTypeRecord
      SerializerLike
      SerializerOptions
      TagFluentBuilder
      TaskBuilderWithPhantom
      TaskCallOptions
      TaskFluentBuilder
      TaskMiddlewareFluentBuilder
      TemporalMiddlewareConfig
      TestFacade
      ThrottleState
      TimeoutError
      TimeoutMiddlewareConfig
      TunnelRunner
      TunnelTagConfig
      TunnelTaskMiddlewarePolicyConfig
      TunnelTaskMiddlewareSidePolicy
      TypeDefinition

      Type Aliases

      AnyResource
      AnyTask
      CommonPayload
      CONTRACT
      ContractsIntersectionInputs
      ContractsIntersectionOutputs
      ContractsUnionInputs
      ContractsUnionOutputs
      DebugConfig
      DebugFriendlyConfig
      DefaultErrorType
      DependencyMapType
      DependencyValuesType
      DependencyValueType
      EnsureInputSatisfiesContracts
      EnsureOutputSatisfiesContracts
      EnsureResponseSatisfiesContracts
      ErrorReference
      ErrorThrowArgs
      EventDeliveryMode
      EventDependency
      EventEmissionFailureMode
      EventEmissionInterceptor
      EventHandlerType
      ExtractContractOf
      ExtractContractsFromCollection
      ExtractEventPayload
      ExtractInputTypeFromContracts
      ExtractOutputTypeFromContracts
      ExtractResourceConfig
      ExtractResourceValue
      ExtractTagsWithNonVoidReturnTypeFromTags
      ExtractTaskInput
      ExtractTaskOutput
      FilterContractsKind
      HasInputContracts
      HasNeverProperty
      HasOutputContracts
      HookExecutionInterceptor
      HookOn
      HookStoreElementType
      HttpClientFactory
      InferInputOrViolationFromContracts
      InferOutputOrViolationFromContracts
      InputArg
      InputCollisionGuard
      InputContractViolationError
      IPhantomTask
      IsAny
      IsImpossibleIntersection
      IsNever
      IsTuple
      IsUnknown
      IsUnspecified
      ITagWithOptionalConfig
      JournalKey
      JsonPrimitive
      KeysWithNever
      LogLevels
      LogPrinterPrintStrategy
      NonVoid
      OnType
      OnUnhandledError
      OutputContractViolationError
      OverridableElements
      PlatformClearTimeout
      PlatformId
      PlatformSetTimeout
      PrintStrategy
      QueueEvent
      QueueEventType
      RegisterableItems
      RequiredKeys
      ResolveConfig
      ResolvedOn
      ResolveInput
      ResourceDependency
      ResourceDependencyValuesType
      ResourceDependencyValueType
      ResourceForkRegisterMode
      ResourceInitFn
      ResourceMiddlewareAttachmentType
      ResourceMiddlewareInterceptor
      ResourceMiddlewareStoreElementType
      RunOptions
      SemaphoreEvent
      SemaphoreEventType
      SerializedNode
      SerializedValue
      ShouldReplaceConfig
      ShouldReplaceInput
      Simplify
      SymbolPolicy
      TaggedResource
      TaggedTask
      TagType
      TaskDependency
      TaskDependencyWithIntercept
      TaskLocalInterceptor
      TaskLocalInterceptorRecord
      TaskMiddlewareAttachmentType
      TaskMiddlewareInterceptor
      TaskMiddlewareStoreElementType
      ThrowsList
      TunnelEventSelector
      TunnelMiddlewareId
      TunnelMode
      TunnelTaskMiddlewarePolicySideConfig
      TunnelTaskRunner
      TunnelTaskSelector
      UnhandledErrorKind
      UnionToIntersection
      UnknownToNever
      ValidOnTarget

      Variables

      allFalse
      CONTRACT
      createContext
      debug
      debugLevels
      EventEmissionFailureMode
      globals
      journal
      levelNormal
      levelVerbose
      r
      symbolAsyncContext
      symbolError
      symbolEvent
      symbolFilePath
      symbolForkedFrom
      symbolHook
      symbolMiddleware
      symbolMiddlewareConfigured
      symbolOptionalDependency
      symbolPhantomTask
      SymbolPolicy
      symbolResource
      symbolResourceMiddleware
      symbolResourceWithConfig
      symbolTag
      symbolTagConfigured
      symbolTask
      symbolTaskMiddleware
      symbolTunneledBy

      Functions

      asyncContext
      bindProcessErrorHandler
      createDefaultUnhandledError
      createHttpClient
      createTestResource
      event
      getConfig
      hook
      isOneOf
      onAnyOf
      override
      resource
      resourceMiddleware
      run
      safeReportUnhandledError
      setPlatform
      tag
      task
      taskMiddleware

      References

      cancellationError → Errors.cancellationError
      EventStoreElementType → definitions.EventStoreElementType
      ResourceStoreElementType → definitions.ResourceStoreElementType
      TaskStoreElementType → definitions.TaskStoreElementType