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 🙏

© 2025 – Pkg Stats / Ryan Hefner

setu.js

v1.4.5

Published

A lightweight HTTP client for Node.js and the browser, with smart adapter selection.

Readme

Setu.js – Modern HTTP Client for JavaScript

npm license downloads

Setu.js is a minimal, powerful, and highly customizable HTTP client built for modern JavaScript applications. With built-in support for retries, timeouts, streaming, and smart defaults, Setu.js is ideal for both frontend and backend environments.

Framework Agnostic - Works with React, Vue, Angular, Next.js, Express, and virtually any JavaScript/TypeScript framework! See FRAMEWORK_COMPATIBILITY.md for details.

✨ Features

  • 📦 Lightweight and zero-config
  • 🔁 Built-in retry mechanism with exponential backoff
  • ⏱️ Timeout support for requests
  • 📡 Streaming and upload/download progress
  • 🧠 Adapter-based engine (browser + Node.js)
  • 💎 Clean API inspired by Axios and modern fetch
  • C++ Optimization Layer - Optional native addon for 2-5x performance boost

🚀 Installation

npm install setu.js

or

yarn add setu.js

Note: The C++ optimization module is optional. If you don't have a C++ compiler installed, Setu.js will automatically use JavaScript implementations. The package works perfectly either way!


📦 Basic Usage

import setu from 'setu.js';

const response = await setu.get('/api/users');
console.log(response.data);
await setu.post('/api/upload', {
  body: formData,
  onUploadProgress: (progress) => {
    console.log(`${progress.loaded}/${progress.total}`);
  }
});

🛠 Core API

setu.get(url, options)

  • Make a GET request
  • Accepts optional retries, timeout, and headers

setu.post(url, options)

  • POST request with JSON or multipart form support
  • Supports onUploadProgress

setu.put(url, options) / setu.delete()

  • Standard REST methods supported

Request Options

{
  headers?: Record<string, string>;
  body?: any;
  retries?: number;           // Default: 0
  retryDelay?: number;        // Default: 1000ms
  timeout?: number;           // Default: 0 (no timeout)
  onUploadProgress?: (progress) => void;
  onDownloadProgress?: (progress) => void;
}

♻ Retry Example

const response = await setu.get('/api/reliable-data', {
  retries: 3,
  retryDelay: 1000
});

⏱ Timeout Example

await setu.get('/api/slow-endpoint', {
  timeout: 3000 // fail after 3s
});

⚡ C++ Optimization Example

Enable native C++ optimizations for 2-5x performance improvements:

await setu.get('/api/data', {
  optimized: true  // Use C++ optimized functions
});

Note: The native module is optional and builds automatically. Setu.js falls back to JavaScript if unavailable. See OPTIMIZATION.md for details.


🎯 Framework Support

Setu.js works with any JavaScript/TypeScript framework:

Frontend

✅ React • Vue.js • Angular • Svelte • Next.js • Nuxt.js • Remix • Solid.js

Backend

✅ Express • Fastify • Koa • NestJS • Hapi • FastAPI (via Node.js)

Runtimes

✅ Node.js • Deno • Bun • Cloudflare Workers • AWS Lambda • Vercel Edge

See FRAMEWORK_COMPATIBILITY.md for detailed examples and integration guides.


🔗 Learn More & Full Documentation

➡️ Full docs with examples, advanced usage and integration guides: https://setujs.dev


❤️ Contributing

We welcome contributions! Open issues, suggest features, or improve the docs.

git clone https://github.com/chaitu426/setu.js.git
cd setu.js
npm install
npm run dev

📄 License

MIT © Chaitanya Abhade


Built with ❤️ for the JavaScript community.