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

http1.1

v2.2.2

Published

Pure-JS TLS 1.3 client + minimal HTTP/1.1 layer — zero work at require() time, flat hot path, X25519 + custom zero-alloc AES-GCM.

Readme

http1.1

Pure-JS TLS 1.3 client + minimal HTTP/1.1 layer for Node.js. Zero dependencies — only node:net, node:crypto, node:events.

Three flat files, one job each:

  • tls.js — RawTls13Socket: TLS 1.3 record layer (X25519, AES-128/256-GCM, HKDF-SHA256/384)
  • http1.js — keep-alive pooled, pipelined HTTP/1.1 client (Agent, request, get)
  • index.js — thin export surface

Features

  • TLS 1.3 only: X25519 key exchange, AES-128/256-GCM, HKDF-SHA256/384
  • Zero work at require() time — the X25519 keypair pool starts lazily on first connect()
  • Flat hot path: preallocated scratch buffers, no per-record closures
  • Agent with keep-alive connection pooling + HTTP pipelining (multiple requests in flight per connection, responses parsed strictly in order)
  • Minimal HTTP/1.1: request() / get() with response/data/end events, Content-Length + chunked decoding, 1xx/204/304/HEAD handling
  • No certificate validation (raw TLS socket); bring your own pinning if needed

Benchmarks (local TLS server, burst of N requests)

| | req/s | |---|---| | node https.Agent (keepAlive) | ~9.6k–11.1k | | http1.1 Agent (keepAlive + pipelining + record coalescing) | ~15k–16.4k |

Install

npm install http1.1

Usage

HTTP/1.1 request

import http from 'http1.1';

var req = http.get({ host: 'example.com', path: '/' }, function(res) {
  console.log('status', res.statusCode);
  res.on('data', function(c) { process.stdout.write(c); });
  res.on('end', function() { console.log('\ndone'); });
});
req.on('error', console.error);
req.end();

POST with body:

var req = http.request({ host: 'api.example.com', path: '/x', method: 'POST' }, cb);
req.end('payload');

Keep-alive agent (recommended for many requests)

import http from 'http1.1';
var agent = new http.Agent({ maxSockets: 50 });

for (var i = 0; i < 100; i++) {
  agent.request({ host: 'example.com', path: '/' }, function(res) {
    res.resume ? res.resume() : res.on('data', function() {});
    res.on('end', function() { console.log('done', res.statusCode); });
  }).end();
}

Connections are reused automatically; idle sockets are picked before opening new ones.

Raw TLS socket

import { RawTls13Socket } from 'http1.1';
var s = new TlsSocket({ host: 'example.com', alpn: ['h2', 'http/1.1'] });
s.on('secureConnect', function() {
  console.log('alpn:', s.negotiatedAlpn);
  s.write(Buffer.from('hello'));
});
s.on('data', function(d) { console.log('got', d.length, 'bytes'); });
s.connect();

API

  • http.request(opts, cb) / http.get(opts, cb) → returns req (EventEmitter); call req.end(body?) to connect + send. cb(res) fires on response headers; res emits data/end.
  • new http.Agent({maxSockets, pipelining}) → keep-alive pool; agent.request(opts, cb), agent.destroy(). pipelining = max requests in flight per connection (default 16).
  • new RawTls13Socket({host, port, ip, alpn}) → .connect(), .write(buf), .destroy(), .destroyed; events: secureConnect, data, close, error, alert.

Notes

  • TLS 1.3 only — TLS 1.2 servers are not supported.
  • Client-side only (no server mode).
  • Certificates are not validated — this is a raw cryptographic client.