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

@pynk/pynk

v0.3.11

Published

Basic low-level package to launch Tor from Node.js using arti-client, no need to have Tor installed.

Readme

Pynk

CI Tag npm

Pynk is a low-level, minimalistic Node.js package to launch and control the Tor network connection without requiring a local Tor installation.
It uses arti-client, a Rust implementation of Tor, to connect directly to the Tor network, enabling secure and anonymous HTTP requests from Node.js environments.

Basic usage

const { TorClient } = require("@pynk/pynk");

(async () => {
  // Target hostname and path
  const hostname = "httpbin.org";
  const path = "/ip";

  // Create a new Tor client with the default configuration
  const client = await TorClient.create();

  // Connect to the target hostname and port (host:port is required)
  const stream = await client.connect(`${hostname}:80`);

  // Create the HTTP GET request
  const request = Buffer.from(
    `GET ${path} HTTP/1.1\r\nHost: ${hostname}\r\nConnection: close\r\n\r\n`,
    "utf8"
  );

  // Send the request
  await stream.write(request);
  await stream.flush(); // Important: make sure all data is sent

  // Read the response
  let response = Buffer.alloc(0);
  while (true) {
    const chunk = await stream.read(4096);
    if (!chunk || chunk.length === 0) break;
    response = Buffer.concat([response, chunk]);
  }

  // Print the full response as a UTF-8 string
  console.log(response.toString("utf8"));
})();
const {
  TorClient,
  TorClientBuilder,
  TorClientConfig,
  OnionServiceConfig,
  OnionV3,
} = require("@pynk/pynk");

(async () => {
  // Configure the Tor client with temporary storage
  const torConfig = TorClientConfig.create();
  torConfig.storage.keystore(true);
  // Set the directory where service keys will be stored
  torConfig.storage.stateDir(`./temp/pynk-${Date.now()}`);

  // Create a client using the configuration
  const client = await TorClient.create(TorClientBuilder.create(torConfig));

  // Create a hidden service configuration
  const config = OnionServiceConfig.create();
  // The nickname is used as the username for the hidden service.
  // See directory: ./temp/pynk-*/keystore/hss/my-hidden-service
  config.nickname("my-hidden-service");

  // Generate ed25519 keys for the .onion service
  const keys = new OnionV3();

  // Create the hidden service using the private key
  const service = client.createOnionServiceWithKey(config, keys.getSecret());
  console.log("Hidden service address:", service.address());

  // Wait for an incoming connection and establish a stream
  // Call service.poll() in a loop to handle each incoming client connection
  service.poll().then(async (rendRequest) => {
    // Accept the client; from now on, it can request new streams to our server
    const streams = await rendRequest.accept();
    // Wait for the next incoming stream request
    const streamRequest = await streams.poll();
    // Accept the new stream
    const stream = await streamRequest.accept();

    // Write and flush data to the client
    await stream.write(Buffer.from("Hello from hidden service!"));
    await stream.flush();
  });

  // Connect to the hidden service as a client
  const clientStream = await client.connect(service.address() + ":80");

  // Read the response from the service
  const messageFromServer = await clientStream.read(4096);

  console.log("Message from server:", messageFromServer.toString("utf8"));
})();