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

reqrio

v0.3.0

Published

A lightweight, high concurrency HTTP request library

Downloads

806

Readme

reqrio-js

reqrio-js is the Node.js binding for reqrio, providing a lightweight, high-performance HTTP and WebSocket client.

Features

  • Native HTTP/HTTPS request engine with low-copy semantics.
  • TLS support powered by BoringSSL.
  • Supports HTTP/1.0, HTTP/1.1, and HTTP/2.0 via ALPN.
  • Custom request headers, cookies, timeout settings, and proxy support.
  • Supports form data, JSON, text, bytes, and multipart file uploads.
  • Includes native WebSocket support.
  • Exposes TLS fingerprint options with Fingerprint and Session methods.

Installation

npm install reqrio

This package relies on native bindings and is intended to be used in Node.js.

Usage

HTTP Requests

const { Session, ALPN } = require('reqrio');

const session = new Session(
  ALPN.HTTP20,
  {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)',
    Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  },
  true,
  true,
);

session.set_timeout({
  connect: 3000,
  read: 3000,
  write: 3000,
  handle: 30000,
  connect_times: 3,
  handle_times: 3,
});

const resp = session.get('https://www.example.com');
console.log('Status:', resp.status_code());
console.log('Body:', resp.text());

session.close();

Request Options

The Session request methods accept an options object with these fields:

  • params: query parameters object
  • data: form body object
  • json: JSON body object
  • bytes: raw bytes payload
  • files: array of multipart file objects
  • ct: content type string
  • sni: custom SNI host string

Expressing multipart file upload

const files = [
  {
    path: './example.txt',
    field_name: 'file',
    filetype: 'text/plain',
  },
];

const response = session.post('https://www.example.com/upload', {
  data: { name: 'test' },
  files,
});
console.log(response.status_code());

API Reference

Session

Constructor:

new Session(
  alpn,
  headers = {},
  verify = true,
  auto_redirect = true,
  key_log = null,
  rand_tls = false,
  token = null,
);

Common methods:

  • session.set_headers(headers)
  • session.add_header(name, value)
  • session.remove_header(name)
  • session.set_proxy(proxy)
  • session.set_timeout(timeout)
  • session.set_cookie(cookie)
  • session.add_cookie(name, value)
  • session.reconnect()
  • session.connect(url)
  • session.close_stream()
  • session.set_callback(func)
  • session.send(method, url, options)
  • session.get(url, options)
  • session.post(url, options)
  • session.put(url, options)
  • session.head(url, options)
  • session.delete(url, options)
  • session.options(url, options)
  • session.trace(url, options)
  • session.patch(url, options)
  • session.close()

Method

HTTP method enum exported from Session.

ALPN

Protocol enum values:

  • ALPN.HTTP10
  • ALPN.HTTP11
  • ALPN.HTTP20

Response

Response methods:

  • response.status_code()
  • response.get_header(name)
  • response.cookies()
  • response.bytes()
  • response.text()
  • response.json()
  • response.close()

WebSocket Support

const { Websocket } = require('reqrio');

const ws = new Websocket();
ws.set_uri('wss://example.com/api/ws');
ws.add_header('User-Agent', 'Mozilla/5.0...');
ws.set_proxy('http://127.0.0.1:1080');
ws.open_raw('wss://example.com', '');

const frame = ws.read();
console.log(frame);
ws.close();

WebSocket methods

  • ws.add_header(name, value)
  • ws.set_proxy(proxy)
  • ws.set_uri(uri)
  • ws.open(urlPtr)
  • ws.open_raw(url, context)
  • ws.read()
  • ws.write(opcode, mask, msg)
  • ws.close()

TLS Fingerprinting

reqrio-js exposes fingerprint support through Session and Fingerprint.

Session fingerprint helpers

  • session.use_random_tls(token)
  • session.set_ja3(ja3, token)
  • session.set_ja4(ja4, token)
  • session.set_finger_by_client_hello(client_hello, token)
  • session.set_finger_by_custom(custom, token)

Fingerprint

Create and customize a fingerprint object:

const { Session, Fingerprint } = require('reqrio');
const session = new Session(ALPN.HTTP20);
const fingerprint = new Fingerprint(session.library, token);

fingerprint.add_cipher_suite(CipherSuite.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256);
fingerprint.add_extension(ExtensionType.StatusRequest);
// ... more fingerprint customization ...

session.set_fingerprint(fingerprint);

Example helper script

The repository includes example.js with sample usage for:

  • GET requests
  • POST form data
  • POST JSON
  • JA3 and JA4 fingerprint usage
  • ClientHello fingerprint usage
  • Custom fingerprint building

Notes

  • Remember to call session.close() to free native resources.
  • response.close() should also be called when the response object is no longer needed.
  • Proxy strings support standard HTTP/SOCKS formats like http://127.0.0.1:1080.

License

Apache-2.0