
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@fortify-ts/core
Advanced tools
Core types, errors, and utilities for the Fortify-TS resilience library.
npm install @fortify-ts/core
# or
pnpm add @fortify-ts/core
Operation<T>, Pattern<T>, Closeable, Resettable interfacesFortifyError and pattern-specific error classesimport {
FortifyError,
CircuitOpenError,
RateLimitExceededError,
BulkheadFullError,
TimeoutError,
MaxAttemptsReachedError,
} from '@fortify-ts/core';
try {
await pattern.execute(operation);
} catch (error) {
if (error instanceof CircuitOpenError) {
// Handle circuit open
} else if (error instanceof RateLimitExceededError) {
// Handle rate limit
}
}
import { asRetryable, asNonRetryable, isRetryableError } from '@fortify-ts/core';
// Mark an error as retryable
throw asRetryable(new Error('Temporary failure'));
// Mark an error as non-retryable
throw asNonRetryable(new Error('Permanent failure'));
// Check if an error is retryable
if (isRetryableError(error)) {
// Retry the operation
}
import {
sleep,
withTimeout,
combineSignals,
throwIfAborted,
NEVER_ABORTED_SIGNAL,
} from '@fortify-ts/core';
// Sleep with cancellation support
await sleep(1000, signal);
// Wrap a promise with timeout
const result = await withTimeout(fetchData(), 5000);
// Combine multiple abort signals
const combined = combineSignals(signal1, signal2);
// Check if signal is aborted
throwIfAborted(signal);
import {
retryConfigSchema,
circuitBreakerConfigSchema,
rateLimitConfigSchema,
bulkheadConfigSchema,
} from '@fortify-ts/core';
// Validate and parse configuration
const config = retryConfigSchema.parse({
maxAttempts: 5,
initialDelay: 100,
});
Operation<T> - Async function that accepts AbortSignal: (signal: AbortSignal) => Promise<T>Pattern<T> - Interface for resilience patterns with execute() methodCloseable - Interface for patterns that need cleanupResettable - Interface for patterns that can reset state| Error | Description |
|---|---|
FortifyError | Base class for all Fortify errors |
CircuitOpenError | Circuit breaker is open |
RateLimitExceededError | Rate limit exceeded |
BulkheadFullError | Bulkhead at capacity |
BulkheadClosedError | Bulkhead has been closed |
TimeoutError | Operation timed out |
MaxAttemptsReachedError | All retry attempts exhausted |
| Function | Description |
|---|---|
sleep(ms, signal?) | Async sleep with cancellation |
withTimeout(promise, ms, signal?) | Add timeout to promise |
executeWithTimeout(operation, ms, signal?) | Execute operation with timeout |
combineSignals(...signals) | Combine multiple AbortSignals |
throwIfAborted(signal) | Throw if signal is aborted |
isAbortError(error) | Check if error is AbortError |
MIT
FAQs
Core types, errors, and utilities for Fortify TS resilience library
We found that @fortify-ts/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.