
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@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 is 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 delays and incremental backoffs.
Install this package via npm:
npm install @megaorm/echo
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 after every retry attempt
// The first retry after: 1000 ms
// The second retry after: 1000 ms + 200 ms
// The third retry after: 1000 ms + 200 ms + 200 ms
// And so on...
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, retryDelay, extraDelay): 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(job): Retries a given function for the configured number of attempts.
job: A sync/async function to retry.job or rejects with the error if all retries fail.Echo.sleep(delay): Delays execution for the specified duration.
delay: Delay time in milliseconds.set: Setter instance.
set.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: Getter instance.
get.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 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.