Registry / devops / reqlib

reqlib

JSON →
library1.0.13jsnpmunverified

reqlib is a Node.js library that simplifies REST API requests with built-in retry, redirect following, and timeout handling. The current stable version is 1.0.13, though the package is no longer actively maintained (last update in 2019). It wraps Node's native http/https modules with a promise-based Request class, offering methods like get, post, put, delete, patch, and head. Unlike popular alternatives like axios or node-fetch, reqlib is specialized for REST consumers with configurable retry on 5xx errors and redirect limits.

npm install reqlib
INSTALL
IMPORT
SIG · REQLIB
R
reqlib
devopsjavascriptv1.0.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Request
import { Request } from 'reqlib'
const Reqlib = require('reqlib'); const req = new Reqlib.Request();
Default import does not exist; only named import 'Request' is available.
Resource
import { Resource } from 'reqlib'
Resource constructor is under construction and may not be fully functional.
Request (type)
import type { Request } from 'reqlib'
No TypeScript types are shipped; this is a type-only import convention.

Creates a Request instance with custom retry, redirect, and timeout settings, then performs a GET request.

import { Request } from 'reqlib'; const req = new Request({ maxRedirectCount: 5, maxRetryCount: 3, timeout: 1000 }); (async () => { try { const result = await req.get('https://api.example.com/data'); console.log(result); } catch (ex) { console.error(ex); } })();
Debug
Known issues
breakingPackage is ESM-only. Using require() will throw.
fix
Use import syntax instead of require().
affects: >=1.0.0
deprecatedLibrary is in maintenance mode; no new features or security updates.
fix
Consider migrating to axios or node-fetch for active support.
affects: >=1.0.13
gotchaOptions object mutates and is not deeply cloned; reused options may cause unexpected behavior.
fix
Create a new options object for each Request instance.
affects: >=1.0.0
gotchaRetry only on 5xx errors; will not retry on network failures or timeouts.
fix
Implement your own retry logic for other types of errors.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: reqlib_1.Request is not a constructor
Using default import instead of named import.
fix
Change to: import { Request } from 'reqlib';
Error: Cannot find module 'reqlib'
Package not installed or not in node_modules.
fix
Run: npm install reqlib
TypeError: Cannot read properties of undefined (reading 'statusCode')
Response object may be undefined if request fails before any response.
fix
Wrap request in try/catch and check for errors before accessing response fields.
Upgrade
Version history
1.0.13latest on npm
Audit
Dependencies
httpsrequiredUses Node.js built-in https module for requests
httprequiredUses Node.js built-in http module for requests
Agent activity
8 hits · last 30 days
node
8
Resources
packagereqlib
reqlib — npm install reqlib · libregistry