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

annas-downloader

v1.0.3

Published

CLI tool to search and download books from Anna's Archive

Readme

Anna's Archive Book Downloader

CLI tool to search and download books from Anna's Archive mirror sites.

Features

  • 🔍 Search — Search books without downloading
  • 📥 Download — Interactive selection or MD5-based download
  • 📊 Batch — Batch download from Excel files with JSON output
  • 🔄 Smart Matching — Auto-select best match, with LLM-assisted fallback
  • 🛡️ Error Handling — CAPTCHA detection, rate limiting, timeout retry

Requirements

  • Node.js 18+
  • Anna's Archive API key
  • cookies.json file (for downloads)

Installation

npm install -g annas-downloader

Install the Claude Code skill (optional but recommended):

annas-download install

This installs the anna-downloader skill to ~/.claude/skills/, enabling Claude Code to help with book searches and downloads.

Quick Start

1. Initialize config

annas-download config init

Edit ~/.annasbook/config.json with your API key and mirror URL.

2. Search for a book

annas-download search --title "The Great Gatsby"

3. Download a book

annas-download download --md5 <md5-hash>

Usage

Search

annas-download search --title "Book Title" --author "Author"
annas-download search --title "Dune" --format pdf
annas-download search --title "1984" --format epub --lang en

Options: | Option | Description | |--------|-------------| | --title <string> | Book title keywords (required) | | --author <string> | Author name | | --format <pdf\|epub> | Filter by format | | --lang <en\|zh> | Language preference (default: en) | | --limit <number> | Max results (default: 5) | | --json | JSON output |

Download

Interactive (search first):

annas-download download --title "The Great Gatsby"

By MD5 directly:

annas-download download --md5 a1b2c3d4e5f6...
annas-download download --md5 a1b2c3d4e5f6... --filename "My Book"

Options: | Option | Description | |--------|-------------| | --md5 <string> | Book MD5 hash (bypasses search) | | --title <string> | Book title keywords (for search) | | --author <string> | Author name | | --format <pdf\|epub> | Filter by format | | --lang <en\|zh> | Language preference | | --filename <string> | Output filename (MD5 mode only) | | --output <dir> | Output directory | | --json | JSON output |

Batch Download

annas-download batch --excel ./books.xlsx
annas-download batch --excel ./books.xlsx --output ./downloads --limit 10
annas-download batch --excel ./books.xlsx --json

Options: | Option | Description | |--------|-------------| | --excel <file> | Excel file path (required) | | --output <dir> | Output directory | | --limit <n> | Max downloads | | --json | JSON output |

Excel Format: | Column | Description | |--------|-------------| | 语言 | "en" to use English title, otherwise Chinese | | 书名 | Chinese title | | Book title | English title | | 作者 | Chinese author | | Author | English author | | 下载状态 | Status (updated automatically) | | 书籍链接 | Optional MD5 link to skip search |

Config Management

annas-download config list    # Show config paths and values
annas-download config path    # Show active config file path
annas-download config init    # Create default config in ~/.annasbook/

Convert EPUB to PDF

annas-download convert ./book.epub
annas-download convert ./book.epub --output ./pdfs

Generate PDF Preview

annas-download preview ./book.pdf
annas-download preview ./book.pdf --output ./previews

Requires pdftoppm from poppler (macOS: brew install poppler)

Configuration

Edit ~/.annasbook/config.json:

{
  "apiKey": "your-api-key",
  "baseUrl": "https://annas-archive.gl",
  "downloadDir": "./downloads",
  "rateLimitMs": 10000,
  "requestTimeoutMs": 30000,
  "downloadTimeoutMs": 300000,
  "maxRetries": 3,
  "proxy": "http://127.0.0.1:7892",
  "downloadLimit": 10,
  "openai": {
    "enable": true,
    "apiKey": "sk-...",
    "baseUrl": "https://api.openai.com/v1",
    "model": "gpt-4o-mini"
  }
}

| Field | Default | Description | |-------|---------|-------------| | apiKey | required | API key for Anna's Archive | | baseUrl | required | Base URL for mirror | | downloadDir | ./downloads | Download directory | | rateLimitMs | 10000 | Delay between requests (ms) | | requestTimeoutMs | 30000 | HTTP request timeout (ms) | | downloadTimeoutMs | 300000 | Download timeout (ms) | | maxRetries | 3 | Max retry attempts | | proxy | - | Optional proxy URL | | downloadLimit | unlimited | Max downloads per run | | openai.apiKey | - | OpenAI API key for LLM matching | | openai.enable | true | Enable LLM fallback |

Error Handling

| Error | Meaning | Solution | |-------|---------|----------| | CAPTCHA_DETECTED | CAPTCHA challenge triggered | Visit search URL in browser, solve CAPTCHA, update cookies.json | | NO_DOWNLOADS_LEFT | Account has no downloads remaining | Use a different account | | RATE_LIMITED | Too many requests | Tool waits 60 seconds automatically | | 502 Bad Gateway | Rate limit too aggressive | Increase rateLimitMs to 10000 or higher |

License

ISC