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

pi-better-export

v0.2.1

Published

Pi's native HTML export with live theme colors, offline LaTeX, equation copying, sharing previews, and print/PDF

Readme

pi-better-export

Exports Pi sessions to HTML with Pi's native exporter: live theme colors, offline LaTeX, equation copying, sharing previews, and print to PDF. Exports retain Pi's session tree, search, filters, and code highlighting.

Install

Requires Node.js 22.19 or later and Pi 1.3 or later, before 2.0.

pi install npm:pi-better-export

Run /reload in an open Pi session.

Export a session

/better-export
/better-export "exports/My session.html"
/better-export --share --redact-text "Acme Internal" sharing.html

Without a filename, the command creates a timestamped HTML file. Relative paths use the session's working directory. Home paths beginning with ~/ and missing parent directories are supported.

Pi asks before replacing a file and offers to open the result in your browser. Without a dialog-capable UI, it saves new files without opening them and refuses overwrites. The command requires a session file; in-memory sessions cannot be exported.

Share an export

A default export includes the full session tree and metadata. These flags limit or redact the exported data:

| Flag | Effect | | --- | --- | | --conversation | Keeps the active branch's user and assistant text and images. Removes tools, thinking, other branches, summaries, system prompts, tool definitions, and local header paths. | | --redact | Replaces detected API tokens, private keys, credentials, bearer headers, email addresses, home paths, and the current project path. | | --redact-text "literal" | Adds an exact text replacement and enables redaction. Repeat for additional text. | | --share | Combines --conversation and --redact. Creates a local file without uploading it. |

Redaction requires a dialog-capable UI. Review the proposed replacements and accept the preview to save. Detection is heuristic and does not scan images. Inspect the HTML before sharing it.

Filtering and redaction change the export only. The original session remains intact.

Copy math and print

Inline math supports $x^2$ and \(x^2\). Display math supports $$...$$ and \[...\]. Code stays literal. Use \$ for a literal dollar sign in ambiguous prose.

Select rendered math to copy its LaTeX source without delimiters. Click a display equation, or focus it and press Enter or Space, to copy it. Clipboard support depends on your browser's restrictions for local files.

KaTeX, CSS, and fonts are embedded for offline use. Unsupported LaTeX stays visible.

Click Print / PDF or use your browser's print command, then choose Save as PDF. Printing uses the displayed branch and current thinking and tool visibility settings. Code wraps, and navigation and controls are hidden.

Compatibility

The extension uses Pi's internal HTML exporter and was tested against Pi 1.3.0. An incompatible template produces an error without replacing an existing destination. Custom extension tools use Pi's fallback HTML rendering.

Develop

npm ci
npm run check
npm test
pi -e ./index.ts

MIT license. Embedded KaTeX assets retain their upstream license notices.