npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@edirect/request

v11.0.54

Published

HTTP request utility for eDirect applications. Provides a thin Axios wrapper (`sendRequest`) that automatically resolves service base URLs from the common `config` folder structure, propagates correlation headers (`SessionId`, `QuoteId`), and optionally h

Readme

@edirect/request

HTTP request utility for eDirect applications. Provides a thin Axios wrapper (sendRequest) that automatically resolves service base URLs from the common config folder structure, propagates correlation headers (SessionId, QuoteId), and optionally handles auth service token injection.

Features

  • Auto-resolves service base URL from node-config service configuration
  • Supports explicit baseURL for external services
  • Propagates SessionId and QuoteId correlation headers automatically
  • Tokenized request variant for auto-authenticated calls (sendTokenizedRequest)
  • Full Axios request config pass-through (headers, timeout, etc.)
  • CommonJS and TypeScript exports

Installation

pnpm add @edirect/request
# or
npm install @edirect/request

Usage

Basic Usage — Named Service (uses config folder)

import { sendRequest } from '@edirect/request';

// Service URL is resolved from config/default.yaml under the service name
const response = await sendRequest('entity-service', {
  headers: {
    Authorization: `Bearer ${token}`,
  },
}).request('GET', '/entities/123');

The service name resolves to the base URL configured in your config/ folder (via node-config):

# config/default.yaml
entity-service:
  url: https://entity-service.internal.example.com

Explicit Base URL — External Services

When the service is not in the config, pass null as service name and set baseURL:

import { sendRequest } from '@edirect/request';

const response = await sendRequest(null, {
  baseURL: 'https://auth.bolttechbroker.net',
  headers: {
    Authorization: `Bearer ${token}`,
  },
}).request('POST', '/token', { grant_type: 'client_credentials' });

CommonJS

const { sendRequest } = require('@edirect/request');

const response = await sendRequest('my-service', {
  headers: { Authorization: `Basic ${token}` },
}).request('GET', '/health');

Correlation Header Propagation

import { sendRequestInstance } from '@edirect/request';

// Set correlation IDs once — all subsequent requests will include them as headers
sendRequestInstance.setIdSendRequest('session-abc-123');
sendRequestInstance.setQuoteIdSendRequest('quote-xyz-456');

// These requests will automatically include SessionId and QuoteId headers
await sendRequestInstance
  .sendRequest('policy-service')
  .request('GET', '/policies');

API

sendRequest(service?, options?)

| Parameter | Type | Description | | --------- | -------------------- | ------------------------------------------------------------------------------- | | service | string \| null | Service name to look up in config/ folder, or null to use options.baseURL | | options | AxiosRequestConfig | Standard Axios request config (headers, timeout, params, etc.) |

Returns { request: Request } where request(method, uri, data?) executes the HTTP call.

Request method

request(method: string, uri: string, data?: unknown): Promise<AxiosResponse>

SendRequest class

For more control, import the SendRequest class directly:

import { SendRequest } from '@edirect/request';

const client = new SendRequest();
client.setIdSendRequest('session-id');
client.setQuoteIdSendRequest('quote-id');

await client.sendRequest('my-service').request('GET', '/endpoint');