
Security News
/Company News
Socket Is Sponsoring Composer and Packagist
Socket has joined the new Composer and Packagist sponsorship program as a launch sponsor, supporting the team that keeps PHP's package ecosystem secure.
A lightweight, flexible HTTP client library with request interception, automatic retry, and logging capabilities, designed for modern web applications.
A lightweight, flexible HTTP client library with request interception, automatic retry, and logging capabilities, designed for modern web applications.
npm install reqforge
const { config, request, retry } = require('reqforge');
// Make a request with automatic retry
retry.withRetry(() => {
return request.get('/users')
.then(res => res.json());
}, { maxRetries: 3, delay: 1000 })
.then(data => console.log(data));
The retry module provides:
withRetry(fn, options) - Execute function with automatic retrycalculateBackoff(attempt, baseDelay, maxDelay) - Calculate exponential backoff delay| Option | Default | Description |
|---|---|---|
maxRetries | 3 | Maximum number of retry attempts |
delay | 1000 | Initial delay in milliseconds |
backoff | 2 | Backoff multiplier |
shouldRetry | () => true | Function to determine if retry should occur |
The errors module provides:
ReqForgeError - Base error classNetworkError - Network request failuresTimeoutError - Request timeout errorsAuthError - Authentication failuresValidationError - Validation errorsErrorCodes - Error code constantscreateErrorFromResponse(response) - Create error from responseThe auth module provides:
login(username, password) - Login and store tokenlogout() - Logout and clear tokengetToken() - Get current auth tokensetToken(token) - Set auth token manuallyisAuthenticated() - Check if authenticatedThe request module provides:
sendRequest(endpoint, data, options) - Generic request methodget(endpoint, options) - GET requestpost(endpoint, data, options) - POST requestput(endpoint, data, options) - PUT requestdel(endpoint, options) - DELETE requestThe Logger class provides:
log(message) - Log a messageinfo(message) - Log an info messagewarn(message) - Log a warning messageerror(message) - Log an error messageThe config module provides:
getBaseURL() - Get the base URL for API requestsAPI_VERSION - Current API versiondefaultConfig - Default configuration objectmergeConfig(customConfig) - Merge custom configuration with defaultsThe utils module provides:
buildURL(baseURL, params) - Build URL with query parametersserializeQuery(obj) - Serialize object to query stringparseQuery(queryString) - Parse query string to objectdeepMerge(target, source) - Deep merge objectsisPlainObject(value) - Check if value is a plain objectdelay(ms) - Delay executionMIT
FAQs
A lightweight, flexible HTTP client library with request interception, automatic retry, and logging capabilities, designed for modern web applications.
The npm package reqforge receives a total of 32 weekly downloads. As such, reqforge popularity was classified as not popular.
We found that reqforge 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.

Security News
/Company News
Socket has joined the new Composer and Packagist sponsorship program as a launch sponsor, supporting the team that keeps PHP's package ecosystem secure.

Research
/Security News
Benign-looking npm packages split malicious functionality across a dependency chain that deploys a cross-platform RAT targeting Alibaba developers.

Research
/Security News
Two Joyfill npm beta releases contain an import-time implant that uses blockchain transactions to retrieve a remote-access trojan.