🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

reqforge

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reqforge

A lightweight, flexible HTTP client library with request interception, automatic retry, and logging capabilities, designed for modern web applications.

Source
npmnpm
Version
0.6.0
Version published
Weekly downloads
32
113.33%
Maintainers
1
Weekly downloads
 
Created
Source

ReqForge

A lightweight, flexible HTTP client library with request interception, automatic retry, and logging capabilities, designed for modern web applications.

Installation

npm install reqforge

Quick Start

const { config, utils, request, Logger, auth } = require('reqforge');

// Get the base URL for API requests
const baseURL = config.getBaseURL();
console.log(baseURL); // https://api.example.com/v1

// Login
auth.login('username', 'password')
  .then(data => console.log('Logged in:', data.token));

// Make a GET request
request.get('/users')
  .then(res => res.json())
  .then(data => console.log(data));

Authentication

The auth module provides:

  • login(username, password) - Login and store token
  • logout() - Logout and clear token
  • getToken() - Get current auth token
  • setToken(token) - Set auth token manually
  • isAuthenticated() - Check if authenticated

Request Methods

The request module provides:

  • sendRequest(endpoint, data, options) - Generic request method
  • get(endpoint, options) - GET request
  • post(endpoint, data, options) - POST request
  • put(endpoint, data, options) - PUT request
  • del(endpoint, options) - DELETE request

Logger

The Logger class provides:

  • log(message) - Log a message
  • info(message) - Log an info message
  • warn(message) - Log a warning message
  • error(message) - Log an error message

Configuration

The config module provides:

  • getBaseURL() - Get the base URL for API requests
  • API_VERSION - Current API version
  • defaultConfig - Default configuration object
  • mergeConfig(customConfig) - Merge custom configuration with defaults

Utilities

The utils module provides:

  • buildURL(baseURL, params) - Build URL with query parameters
  • serializeQuery(obj) - Serialize object to query string
  • parseQuery(queryString) - Parse query string to object
  • deepMerge(target, source) - Deep merge objects
  • isPlainObject(value) - Check if value is a plain object
  • delay(ms) - Delay execution

License

MIT

Keywords

http

FAQs

Package last updated on 23 May 2026

Did you know?

Socket

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.

Install

Related posts