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

iredox-tbook-tui

v1.0.2

Published

A premium terminal book reader built with OpenTUI

Downloads

23

Readme

📖 TBook TUI

A premium Terminal Book Reader built with OpenTUI — read EPUB & PDF books in your terminal with a modern, visually stunning interface.

TBook Bun TypeScript

✨ Features

📚 Core Reading

  • EPUB, PDF, MD, & TXT Support — Full chapter parsing with styled headings, quotes, and paragraphs
  • Library Management — SQLite-backed book library with search and sorting
  • Reading Progress — Automatic save/resume with per-book chapter tracking
  • Vim Keybindsj/k scroll, h/l chapters, space page-down, g/G jump

💻 Programming Book Support

  • Syntax Highlighting — Auto-detects 10+ languages (Rust, Python, JS/TS, Go, Java, C, SQL, Bash…)
  • Code Blocks — Bordered boxes with language labels, line numbers, and colored syntax
  • Inline Codecode markers rendered with cyan background
  • Code Focus ModeEnter on a code block opens a non-wrapping horizontal-scroll modal
  • Copy to Clipboardc copies code blocks or selected text to your system clipboard (OSC 52)
  • Collapse Blocks+ / - to collapse/expand long code blocks
  • Callouts/Notes — Tip, Warning, Note, Important admonitions with colored sidebar

🎨 Premium UI

  • Tokyo Night Design — Dark & Light theme with T toggle
  • ASCII Art Splash — Stunning first-impression branding
  • Gradient Progress Bars — Color-coded completion tracking
  • Toast Notifications — Auto-dismissing feedback overlays

🔥 Power Features

  • Visual Minimapm / M to toggle a structural sidebar minimap indicating scroll position
  • Text Zoom+/- to adjust reading width (8 zoom levels)
  • Auto-Scrolla to toggle, A to cycle speed (Slow/Normal/Fast/Rapid)
  • Focus Modef to hide sidebar & status bar for distraction-free reading
  • Full-Text Search/ to search within the current book with context snippets
  • Chapter TOC Modalt to jump to any chapter with word counts
  • Bookmarksb to save, B to view/jump-to/delete bookmarks
  • Help Overlay? for complete keybind reference
  • Book Deletiond to remove books from library

✎ Select & Annotate

  • Select Modes enters word cursor for precise text selection
  • Visual Modev extends to range selection across paragraphs
  • Highlight Textm marks selected text with persistent highlights
  • Dictionary Lookupd/D to look up word definitions via free API
  • Vocabulary TrackerV shows all looked-up words with lookup counts
  • Annotations PanelN views all highlights with jump-to-source
  • RSVP Speed Readerr flashes words one at a time (50-1500 WPM)

🤖 AI & Utilities

  • AI AssistantE summarizes the chapter (Normal mode) or explains selections (Select mode)
  • Multi-Provider AI — Uses local Ollama by default, supports OpenAI via config
  • Text-to-Speech (TTS)p / P reads chapters or selected paragraphs aloud natively
  • Obsidian/Logseq ExportX exports notes & bookmarks as markdown with YAML frontmatter
  • Persistent Config — Theme, zoom, scroll speed, export format saved to ~/.tbook/config.json
  • Session Persistence — All preferences survive between sessions

📊 Statistics

  • Reading Stats Dashboard — Daily word count bar charts
  • Session Tracking — Words read + minutes recorded per session
  • Streak Counter — Daily reading streak tracking

📂 Smart Import

  • Async Streaming Scan — Files appear in real-time as they're discovered
  • Multi-SelectSpace to check files, batch import with Enter
  • Live Search/Filter/ to filter results by name, path, or format
  • Sort Options — Cycle through name, size, or format sorting with s
  • Metadata Previewp to peek at title, author, chapters, and word count before importing
  • Configurable Depth+/- to adjust scan depth (1-8 levels, persisted)
  • Recent Paths — Remembers last 10 scanned directories
  • Direct File Import — Paste a .epub/.pdf path and press Enter
  • Duplicate Detection — Warns when a book with the same title+author exists
  • Bulk Progress — Progress bar with cancel support for batch imports

🚀 Quick Start

# Prerequisites: Bun + Zig
bun install
bun start

For PDF support, install poppler-utils:

# Ubuntu/Debian
sudo apt install poppler-utils

# macOS
brew install poppler

🎮 Controls

Reader

| Key | Action | |-----|--------| | j / k / / | Scroll up/down | | Space | Page down | | g / G | Jump to top / bottom | | h / l / / | Previous / next chapter | | + / - | Zoom text wider / narrower | | a | Toggle auto-scroll | | A | Cycle auto-scroll speed | | f | Toggle focus mode | | T | Toggle dark / light theme | | m / M | Toggle visual minimap | | p / P | Read chapter aloud (TTS) | | t | Chapter list (TOC modal) | | / | Search in book | | b | Add bookmark | | B | View bookmarks | | N | View annotations & highlights | | V | Vocabulary list | | s | Enter select mode | | r | RSVP speed reader | | D | Dictionary lookup | | E | AI summarize chapter | | X | Export to Obsidian/Logseq | | Tab | Toggle chapter sidebar | | ? | Help overlay | | q | Back to library |

Select Mode

| Key | Action | |-----|--------| | h / l | Move cursor left / right (character/word) | | j / k | Move cursor up / down (paragraph) | | v | Toggle visual mode (range select) | | m | Mark / highlight selection | | c | Copy selection or code block to clipboard | | + / - | Collapse / expand code block | | p | Read selection aloud (TTS) | | d | Dictionary lookup on word | | E | AI explain selection | | Enter | Confirm selection / Open Code Focus Modal | | Esc | Exit select mode |

Library

| Key | Action | |-----|--------| | j / k / / | Navigate books | | Enter | Open selected book | | / | Search library | | n | Import new books | | i | Reading statistics | | d | Delete selected book | | ? | Help overlay | | q | Back to splash |

Import

| Key | Action | |-----|--------| | Enter | Scan directory / import selected | | a | Import all found files | | j / k / / | Navigate file list | | Ctrl+d / Ctrl+u | Page down / up (jump 10) | | g / G | Jump to top / bottom | | Space | Toggle multi-select checkmark | | / | Search / filter results | | s | Cycle sort (name → size → format) | | p | Preview file metadata | | + / - | Increase / decrease scan depth | | 1 / 2 / 3 | Quick scan Home / Documents / Downloads | | 4-6 | Recent scan paths | | e | Edit scan path | | Esc | Cancel import / close filter | | q | Back to library |

📁 Architecture

src/
├── app.ts                  # View routing & lifecycle
├── views/
│   ├── splash.ts           # ASCII art welcome screen
│   ├── library.ts          # Book grid with progress cards
│   ├── reader.ts           # Main reading experience
│   ├── import.ts           # File scanner & importer (EPUB + PDF)
│   └── stats.ts            # Reading statistics dashboard
├── components/
│   ├── status-bar.ts       # Bottom bar with progress & keybinds
│   ├── toast.ts            # Auto-dismissing notifications
│   ├── help-overlay.ts     # Full keybind reference modal
│   ├── chapter-toc.ts      # Chapter navigation modal
│   ├── search-modal.ts     # Full-text search with results
│   ├── bookmarks-panel.ts  # Bookmark viewer & manager
│   ├── dictionary-modal.ts # Word definition lookup
│   ├── vocabulary-panel.ts # Vocabulary list with definitions
│   ├── annotations-panel.ts# Highlights & annotations viewer
│   └── rsvp-reader.ts      # RSVP speed reader overlay
├── services/
│   ├── database.ts         # SQLite via bun:sqlite
│   ├── epub-parser.ts      # EPUB → structured chapters
│   ├── pdf-parser.ts       # PDF → chapters via pdftotext
│   ├── export.ts           # Obsidian/Logseq markdown export
│   ├── config.ts           # User config persistence
│   └── dictionary.ts       # Free dictionary API client
└── utils/
    ├── theme.ts            # Tokyo Night Book dual-theme system
    └── html-to-text.ts     # HTML → styled terminal text

🗄️ Data Storage

All data is stored in ~/.tbook/:

  • tbook.db — SQLite database (books, bookmarks, reading stats, highlights, vocabulary)
  • config.json — User preferences (theme, zoom, export format)

📄 License

MIT