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

fetch-tor-proxy

v1.0.4

Published

Allows fetching resources through a proxy server, with support for authentication and custom headers.

Readme

fetch-tor-proxy

fetch-tor-proxy lets you perform HTTP(S) requests through a SOCKS proxy (Tor), using node-fetch and socks-proxy-agent.

Installation

npm install fetch-tor-proxy

Quick Start

import { proxiedFetch } from 'fetch-tor-proxy';

const response = await proxiedFetch('https://api.ipify.org?format=json');
const body = await response.text();
console.log(body);

Available alias:

import { fetch } from 'fetch-tor-proxy';

Options

proxiedFetch(url, options) accepts node-fetch RequestInit options and adds:

  • proxyUrl?: string (default: socks5h://127.0.0.1:9050)
  • killTor?: boolean (default: true)

Example:

import { proxiedFetch } from 'fetch-tor-proxy';

const response = await proxiedFetch('https://httpbin.org/anything', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ hello: 'world' }),
  killTor: false,
});

console.log(await response.json());

Tor Process Management

The library also exports TorProcessManager which now exposes a few convenience helpers and events:

import { TorProcessManager } from 'fetch-tor-proxy';

const manager = new TorProcessManager({
  bootstrapTimeoutMs: 30_000,
  // custom logger or spawnOnNonWindows can be supplied here
});

// You can listen for lifecycle events if you need to know when Tor is ready
// or if it exits unexpectedly.
manager.on('ready', () => console.log('tor is bootstrapped')); 
manager.on('error', err => console.error('tor failed', err));
manager.on('exit', code => console.log('tor exited', code));

await manager.start();
// ... your network calls ...
await manager.restart(); // convenience helper that stops then starts again
manager.stop();

The constructor accepts additional options:

  • torArgs?: string[] – extra command‑line arguments for the tor binary.
  • spawnOnNonWindows?: boolean – opt into spawning Tor on Linux/macOS too.
  • logger?: (...args) => void – custom debug/logger function.

Platform Behavior

  • Windows (win32): the library starts tor using tor-expert-bundle/tor and waits for Bootstrapped 100%.
  • Linux/macOS: the library does not spawn a Tor process. Tor must already be available (system service, container, etc.).

Development

pnpm build

The TypeScript build output is generated in the build/ folder.