
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
megaorm-echo
Advanced tools
This package designed to provide robust retry mechanisms for your operations. It allows you to configure retry logic with customizable delay and incremental backoffs.
This package designed to provide robust retry mechanisms for your operations, such as network requests or database queries. It allows you to configure retry logic with customizable delay and incremental backoffs.
Install the package using npm:
npm install megaorm-echo
Here’s an improved version of the Getting Started section for clarity, grammar, and conciseness:
To start using Echo, create an instance with optional configurations:
const { Echo } = require('megaorm-echo');
// Create an Echo instance with:
// - maxRetry: 10 (maximum retries)
// - retryDelay: 1000 ms (delay between retries)
// - extraDelay: 500 ms (incremental delay added after each retry)
const echo = new Echo(10, 1000, 500);
The retry method executes a job and retries it according to the configuration.
const fetchSuccess = () => {
return new Promise((resolve) => {
setTimeout(() => resolve('Success'), 100);
});
};
// Executes the job and resolves on the first attempt after 1000 ms.
echo.retry(fetchSuccess).then((result) => console.log(result)); // Output: Success
const fetchFail = () => {
return new Promise((_, reject) => {
setTimeout(() => reject(new Error('Fail')), 100);
});
};
// Retries the job 10 times before rejecting.
// - Each retry waits 1000 ms (10 seconds total for 10 retries).
// - An additional 500 ms is added incrementally after each retry.
echo.retry(fetchFail).catch((error) => console.log(error.message)); // Output: Fail
You can configure Echo using the following methods:
set.maxRetry(number): Sets the maximum number of retries. Must be an integer greater than 0.set.retryDelay(number): Sets the delay (in milliseconds) between retries. Must be an integer greater than 0.set.extraDelay(number): Adds an incremental delay (in milliseconds) after each retry. Must be an integer greater than or equal to 0.echo.set.maxRetry(5); // Retry job 5 times
echo.set.retryDelay(1000); // After 1000 ms
echo.set.extraDelay(200); // Add 200 ms to 1000 ms before every retry attempt
Retrieve current configurations:
get.maxRetry(): Returns the current maxRetry value.get.retryDelay(): Returns the current retryDelay value.get.extraDelay(): Returns the current extraDelay value.console.log(echo.get.maxRetry()); // 5
console.log(echo.get.retryDelay()); // 1000
console.log(echo.get.extraDelay()); // 200
constructor(maxRetry: number = 3, retryDelay: number = 500, extraDelay: number = 0)
Initializes a new Echo instance.
maxRetry: Maximum number of retries. Default: 3.retryDelay: Delay between retries (in milliseconds). Default: 500.extraDelay: Additional delay added incrementally after each retry (in milliseconds). Default: 0.retry<T>(job: () => T | Promise<T>): Promise<T>Retries a given function or job for the configured number of attempts.
job: A regular function or async operation to retry.job or rejects with the error if all retries fail.static sleep(delay: number): Promise<void>Delays execution for the specified duration.
delay: Delay time in milliseconds.set Methodsset.maxRetry(maxRetry: number): Sets the maximum number of retries.set.retryDelay(retryDelay: number): Sets the delay between retries.set.extraDelay(extraDelay: number): Sets the additional incremental delay.get Methodsget.maxRetry(): Gets the current maxRetry value.get.retryDelay(): Gets the current retryDelay value.get.extraDelay(): Gets the current extraDelay value.FAQs
This package designed to provide robust retry mechanisms for your operations. It allows you to configure retry logic with customizable delay and incremental backoffs.
We found that megaorm-echo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.