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

fluxion-http

v1.0.2

Published

A minimal, zero-dependency HTTP client, status checker, and response formatter for Node.js and TypeScript

Readme

Fluxion HTTP

A minimal, zero-dependency HTTP client, status checker, and response formatter for Node.js and TypeScript.

Features

  • Lightweight - No external dependencies, only uses Node.js built-in modules
  • TypeScript Support - Fully typed with excellent IDE support
  • Status Checking - Check HTTP status codes for multiple URLs
  • Dual Format - CommonJS and ES Modules support
  • Fast - Minimal overhead, built on Node.js http/https modules
  • MIT Licensed - Open source and free to use

Installation

npm install fluxion-http
or
yarn add fluxion-http

Usage

Basic HTTP Request

import { request } from 'fluxion-http';

const data = await request({ 
  url: 'https://jsonplaceholder.typicode.com/users/1' 
});

console.log(data);

POST Request with Body

import { request } from 'fluxion-http';

const response = await request({
  url: 'https://jsonplaceholder.typicode.com/posts',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: {
    title: 'Hello World',
    body: 'This is a test post',
    userId: 1
  }
});

console.log(response);

Check Multiple URLs

import { statusCheck } from 'fluxion-http';

const results = await statusCheck([
  'https://google.com',
  'https://example.com',
  'https://github.com'
]);

console.log(results);
// [
//   { url: 'https://google.com', status: 200, ok: true, responseTimeMs: 150 },
//   { url: 'https://example.com', status: 200, ok: true, responseTimeMs: 200 },
//   { url: 'https://github.com', status: 200, ok: true, responseTimeMs: 180 }
// ]

Parse Response Data

import { parseResponse } from 'fluxion-http';

const data = parseResponse('{"name":"John"}', 'application/json');
console.log(data); // { name: 'John' }

API Reference

request(options)

Make an HTTP request and return parsed JSON response.

Options:

  • url (string, required) - The URL to request
  • method (string, optional) - HTTP method (GET, POST, PUT, DELETE, etc.). Defaults to 'GET'
  • headers (object, optional) - Custom HTTP headers
  • body (any, optional) - Request body (will be stringified as JSON)
  • timeout (number, optional) - Request timeout in milliseconds

Returns: Promise resolving to parsed response data (or raw string if not JSON)

statusCheck(urls)

Check HTTP status codes for multiple URLs.

Parameters:

  • urls (string[]) - Array of URLs to check

Returns: Promise resolving to array of StatusResult objects

StatusResult:

{
  url: string;
  status: number;
  ok: boolean;
  responseTimeMs: number;
}

parseResponse(data, contentType?)

Parse response data based on content type.

Parameters:

  • data (unknown) - The data to parse
  • contentType (string, optional) - MIME type to determine parsing strategy

Returns: Parsed data or null if parsing fails

Examples

Health Check Service

import { statusCheck } from 'fluxion-http';

async function checkServices() {
  const urls = [
    'https://api.example.com',
    'https://db.example.com',
    'https://cache.example.com'
  ];

  const results = await statusCheck(urls);
  const allHealthy = results.every(r => r.ok);
  
  console.log(allHealthy ? 'All services OK' : 'Some services down');
  return results;
}

API Data Fetching

import { request } from 'fluxion-http';

async function fetchUserData(userId: number) {
  try {
    const user = await request({
      url: `https://api.example.com/users/${userId}`,
      timeout: 5000
    });
    return user;
  } catch (error) {
    console.error('Failed to fetch user:', error);
    throw error;
  }
}

TypeScript Support

All types are included and fully typed:

import { request, statusCheck, parseResponse } from 'fluxion-http';
import type { RequestOptions, StatusResult } from 'fluxion-http';

const options: RequestOptions = {
  url: 'https://api.example.com/data',
  method: 'POST',
  headers: { 'Authorization': 'Bearer token' },
  body: { key: 'value' }
};

const results: StatusResult[] = await statusCheck(['https://example.com']);

Requirements

Node.js 14.0.0 or higher