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

@peppa_q/attach-image-path

v1.0.0

Published

Pi extension that detects image file paths in your prompt, reads the file, and injects the real image into the model so it always sees the picture.

Readme

attach-image-path

A Pi extension that detects image file paths in your prompt, reads the file, and injects the real image into the model — so the model always sees the picture instead of treating the path as plain text.

This fixes the common case where you paste a local screenshot path (e.g. from Snipping Tool) and the model never actually looks at the image.

What it does

Detects an image path in your message (Windows C:\..., WSL /mnt/c/..., or relative paths), reads the file, converts it to base64, and attaches it directly to the prompt via the input transform's images field. The image is fed to the model as a real image, so it's guaranteed to be seen.

Features

  • Windows + WSL paths — converts C:\... to /mnt/c/... using the WSL-native wslpath, honoring your configured mount point in /etc/wsl.conf
  • Space-tolerant — handles paths with spaces like C:\Program Files\My App\shot.png
  • Magic-byte mime detection — detects PNG/JPEG/GIF/WebP/BMP from file headers, not just the extension
  • Size guard — rejects images over 20MB with a clear warning

Install

pi install npm:@peppa_q/attach-image-path

Or try it for one session:

pi -e npm:@peppa_q/attach-image-path

Platform support

This extension is built for Windows + WSL — it exists to turn the Windows screenshot paths you paste (like C:\Users\...\ScreenClip\xxx.png) into images the model can actually see.

  • Windows drive paths (C:\...) are converted via the WSL-native wslpath command, so this works when pi runs inside WSL. If you run pi directly on Windows (not through WSL), the wslpath command is unavailable and drive paths won't resolve.
  • macOS / Linux: native paths (/Users/..., /home/..., ./x.png, /tmp/...) work out of the box. Windows drive paths (C:\...) are not converted — they only make sense on a machine with the matching drive.

If you primarily use pi on Windows, the typical setup is: screenshots live on the Windows filesystem, and you run pi inside WSL so wslpath bridges the two.

Usage

Just paste an image path into your prompt. For example:

C:\Users\demo\Pictures\screenshot.png 这是什么

The extension reads the file, attaches the image, and the model sees it directly.

How it works

It subscribes to the input event. When the prompt contains an image path, it:

  1. Extracts the path (Windows, WSL, or relative)
  2. Normalizes it to a readable absolute path (wslpath for Windows paths)
  3. Reads the file and converts it to base64
  4. Injects the image via the transform result's images field

Notes

  • Uses only Node built-in modules (node:fs/promises, node:path, node:child_process) and Pi core packages (declared as peer dependencies). No bundled runtime dependencies.

License

MIT