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

torlens

v0.0.1

Published

TorLens is a comprehensive library for querying, analyzing, and monitoring Tor network nodes.

Readme

TorLens

npm License

TorLens is a comprehensive library for querying, analyzing, and monitoring Tor network nodes.TorLens provides developers with fine-grained access to detailed information about Tor relays and bridges.

✨ Features

  • Complete Data Access: Query all available information about Tor relays and bridges
  • Targeted Searches: Find nodes by fingerprint, country, hostname, flags, and more
  • Performance Analysis: Analyze bandwidth, weight, and performance metrics
  • Advanced Filtering: Filter by multiple criteria simultaneously
  • Exit Policy Analysis: Check port permissions and exit policies
  • Type-Safe: Full TypeScript support with comprehensive type definitions

🧅 Peel the Net

For a live, visual exploration of the Tor network, visit our companion web platform:

🌐 Website

Peel the Net is a real-time web platform that visualizes and documents every active Tor node with detailed public metadata. From entry guards to exit relays, Peel the Net helps you peel back the layers of the Tor network and explore its architecture in depth.

Features:

  • Live visualization of Tor nodes worldwide
  • Detailed node information (fingerprints, IP addresses, flags, etc.)
  • Updated every 30 minutes
  • Downloadable datasets in JSON and CSV formats

Repository: GitHub - 0xPratikPatil/peel-the-net Dataset: Tor Node Dataset

Installation

npm install torlens

Usage

import { TorLens } from 'torlens';

// Create a new TorLens instance
const torLens = new TorLens();

// Basic search
async function searchNodes() {
  const results = await torLens.search('exit');
  console.log(`Found ${results.relays.length} relays`);
}

// Get a specific relay by fingerprint
async function getRelay() {
  const relay = await torLens.getRelayByFingerprint('000F3EB75342BE371F1D8D3FAE90890AEB5664EE');
  console.log(relay?.nickname);
}

// Get relays by country
async function getRelaysByCountry() {
  const relays = await torLens.getRelaysByCountry('us');
  console.log(`Found ${relays.length} relays in the US`);
}

// Get relays with specific flags
async function getGuardRelays() {
  const relays = await torLens.getRelaysByFlags(['Guard', 'Fast']);
  console.log(`Found ${relays.length} relays with Guard and Fast flags`);
}

// Find relays that allow specific ports
async function findRelaysWithPort() {
  const relays = await torLens.getRelaysByPort(80);
  console.log(`Found ${relays.length} relays that allow port 80`);
}

// Find relays by AS number
async function findRelaysByAS() {
  const relays = await torLens.getRelaysByAS('399820');
  console.log(`Found ${relays.length} relays with AS number 399820`);
}

// Find top relays by consensus weight
async function findTopRelays() {
  const relays = await torLens.getTopRelaysByWeight(5);
  console.log('Top 5 relays by consensus weight:');
  relays.forEach(relay => {
    console.log(`${relay.nickname}: ${relay.consensus_weight}`);
  });
}

// Find relays by OR address
async function findRelaysByORAddress() {
  const relays = await torLens.getRelaysByORAddress('204.137.14.106');
  console.log(`Found ${relays.length} relays with the specified OR address`);
}

// Find relays by exit address
async function findRelaysByExitAddress() {
  const relays = await torLens.getRelaysByExitAddress('204.137.14.106');
  console.log(`Found ${relays.length} relays with the specified exit address`);
}

// Find relays by hostname
async function findRelaysByHostname() {
  const relays = await torLens.getRelaysByHostname('atomicnetworks.co');
  console.log(`Found ${relays.length} relays with the specified hostname`);
}

// Advanced search with multiple parameters
async function advancedSearch() {
  const results = await torLens.advancedSearch({
    running: 'true',
    country: 'us',
    flag: 'Guard'
  });
  console.log(`Found ${results.relays.length} relays`);
}

📚 API Reference

Methods

Basic Methods
  • search(searchTerm?: string): Promise<TorDetails> - Search for Tor nodes
  • advancedSearch(params: Record<string, string>): Promise<TorDetails> - Advanced search with multiple parameters
Relay Methods
  • getRelayByFingerprint(fingerprint: string): Promise<TorRelay | undefined> - Get relay by fingerprint
  • getRelaysByNickname(nickname: string): Promise<TorRelay[]> - Get relays by nickname
  • getRelaysByORAddress(orAddress: string): Promise<TorRelay[]> - Get relays by OR address
  • getRelaysByExitAddress(exitAddress: string): Promise<TorRelay[]> - Get relays by exit address
  • getRelaysByHostname(hostname: string): Promise<TorRelay[]> - Get relays by hostname (verified or unverified)
  • getRelaysByVerifiedHostname(hostname: string): Promise<TorRelay[]> - Get relays by verified hostname
  • getRelaysByUnverifiedHostname(hostname: string): Promise<TorRelay[]> - Get relays by unverified hostname
  • getRelaysByCountry(countryCode: string): Promise<TorRelay[]> - Get relays by country code
  • getRelaysByAS(asNumber: string): Promise<TorRelay[]> - Get relays by AS number
  • getRelaysByASName(asName: string): Promise<TorRelay[]> - Get relays by AS name
  • getRelaysByPlatform(platform: string): Promise<TorRelay[]> - Get relays by platform
  • getRelaysByVersion(version: string): Promise<TorRelay[]> - Get relays by Tor version
  • getRelaysByVersionStatus(status: string): Promise<TorRelay[]> - Get relays by version status
  • getRelaysByMinBandwidth(minBandwidth: number): Promise<TorRelay[]> - Get relays by minimum bandwidth
  • getRelaysByContact(contactInfo: string): Promise<TorRelay[]> - Get relays by contact information
  • getRelaysByPort(port: number): Promise<TorRelay[]> - Get relays that allow a specific port
  • getTopRelaysByWeight(limit?: number): Promise<TorRelay[]> - Get top relays by consensus weight
  • getRelaysByMinRunTime(minDays: number): Promise<TorRelay[]> - Get relays running for at least the specified duration
  • getRelaysByFlags(flags: string[]): Promise<TorRelay[]> - Get relays with specific flags
Bridge Methods
  • getAllBridges(): Promise<TorBridge[]> - Get all bridges
  • getBridgeByFingerprint(fingerprint: string): Promise<TorBridge | undefined> - Get bridge by fingerprint
  • getBridgesByTransport(transport: string): Promise<TorBridge[]> - Get bridges by transport type

🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.

🔗 Links