esbuild bundles it (bundle, minify, format: 'esm', platform: 'browser'), and the output is gzipped with Node’s zlib. The size is that gzip length divided by 1024.
The budget column is enforced in CI: npm run check:size fails when a scenario grows past it. To reproduce:
Terminal window
npmrunbuild && nodescripts/size.mjs
Your bundler, minifier and compression will give slightly different numbers; the ratios between rows hold.
ResiliencePipelineBuilder adds Polly-style addRetry() / addTimeout() / … shortcuts on top, at the cost of
bundling every strategy. Strategies run in the order they are added: the first one added is the outermost.
Options are validated and strategy state (e.g. circuit breaker) is created on build().
ResiliencePipelineBuilder adds Polly-style addRetry() / addTimeout() / … shortcuts on top, at the cost of
bundling every strategy. Strategies run in the order they are added: the first one added is the outermost.
Options are validated and strategy state (e.g. circuit breaker) is created on build().
CircuitBreakerOptions<T>.consecutiveFailures?: number |undefined
Break after this many failures in a row (a success resets the count). Simple and good for low traffic.
When set without failureRatio, the ratio check is off and only this rule applies.
Polly-style builder with a shortcut for every strategy: addRetry(), addTimeout(), addCircuitBreaker(), …
Convenient, but it bundles every strategy. For the smallest browser bundle use PipelineBuilder with
retryStrategy(), timeoutStrategy(), … instead; the two are interchangeable.
The type parameters track which errors the pipeline can raise, for pipeline.settle() + Outcome.match().
Polly-style builder with a shortcut for every strategy: addRetry(), addTimeout(), addCircuitBreaker(), …
Convenient, but it bundles every strategy. For the smallest browser bundle use PipelineBuilder with
retryStrategy(), timeoutStrategy(), … instead; the two are interchangeable.
The type parameters track which errors the pipeline can raise, for pipeline.settle() + Outcome.match().
CircuitBreakerOptions<any>.consecutiveFailures?: number |undefined
Break after this many failures in a row (a success resets the count). Simple and good for low traffic.
When set without failureRatio, the ratio check is off and only this rule applies.
Use PipelineBuilder with xStrategy() factories in browser and edge code.ResiliencePipelineBuilder is the same builder with an addX() shortcut for every strategy, which is why it costs the full 15.1 KB. The two produce the same pipeline and mix freely.
Use the one-liners for one-off calls.retry() and withTimeout() build their strategy directly and skip the builder.
Circuit breaker extensions are separate modules.circuitHealthCheck() and sharedCircuitState() are only bundled when you import them.
Import subpaths directly.resilience-pipeline/outcome loads only the outcome helpers and error types. /fetch, /axios, /otel, /prometheus, /redis and the framework adapters are separate entry points and never enter a bundle that doesn’t import them.
On the server it rarely matters. For Node services, prefer ResiliencePipelineBuilder for readability.