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

@riverai7z/pi-read

v0.1.0

Published

Enhanced read tool for pi with robust text decoding, streaming, notebooks, and paged PDFs

Downloads

18

Readme

@riverai7z/pi-read

Enhanced read tool for pi:

  • Similar-path suggestions and macOS screenshot thin-space recovery
  • UTF-8/UTF-16LE/UTF-16BE BOM detection and LF normalization
  • Bounded streaming reads for large text files
  • Exact path/range/mtime deduplication within the current session context
  • Readable .ipynb cells, outputs, errors, and visualizations
  • Paged PDF rendering with pages: "1-5"

Install

pi install npm:@riverai7z/pi-read

For local development:

cd /path/to/pi-read
pi -e .
# or
pi install .

The package overrides pi's built-in read tool. Pi displays an override warning when it loads; this is expected.

PDF support

PDF support is checked lazily, only when a PDF is first read. It uses Poppler's pdfinfo and pdftoppm locally to render selected pages. The extension never installs system software automatically.

# macOS
brew install poppler

# Debian / Ubuntu
sudo apt install poppler-utils

# Fedora
sudo dnf install poppler-utils

PDFs with at most 10 pages can be read without pages. Larger PDFs require a range. A single call accepts at most 20 pages:

read({ path: "report.pdf", pages: "1-5" })
read({ path: "report.pdf", pages: "21-" })

Rendered page images are included in the next request to the active model provider. Their cumulative Base64 payload is capped at 8 MiB per call; pages beyond that limit are reported as omitted, so use smaller ranges when needed. The extension does not upload the original PDF as a document block.

Text limits

Text output is capped at 2,000 lines or 50KB, whichever comes first. The result includes the next offset when more content remains:

read({ path: "large.log", offset: 2001, limit: 2000 })

Files under 10 MiB use a fast whole-file path. Larger files are decoded incrementally and only requested lines are retained in memory.

Notebook behavior

Notebook cells are returned in source order. Code, Markdown, stream output, rich text, exceptions, and supported image MIME outputs are associated with their originating cell. HTML and JavaScript outputs are not executed.

Deduplication

The cache key contains the canonical path, resource type, and exact text/PDF range. An unchanged mtime returns a short reference to the earlier result. Cache state is memory-only and is cleared when a session starts or compaction succeeds.

Development

npm install
npm test
npm run typecheck
npm run pack:check

Requires Node.js 22.19 or later and @earendil-works/pi-coding-agent 0.84.4 or later. Version 0.84.4 is required because the extension uses the public detectSupportedImageMimeTypeFromFile() export.