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

trmnl-plugin-preview

v0.3.0

Published

Local preview server for third-party TRMNL plugin markup endpoints.

Readme

TRMNL Preview Server

Preview third-party TRMNL plugin markup locally before it reaches a device.

The preview server connects to your plugin's plugin_markup_url, validates the response, and renders all four TRMNL layout variants in a desktop workspace. It is intended for plugin authors who already have a local or remote endpoint that returns TRMNL markup JSON.

The tool runs entirely on your machine. It does not upload your markup, credentials, diagnostics, screenshots, or plugin data to any preview service. When you use the default local target mode, requests stay inside your local development environment.

Where This Fits

trmnl-plugin-preview is for Third Party plugins: hosted endpoints that return TRMNL markup in response to a plugin_markup_url request. If you're building a local Liquid-based Private Plugin or Recipe project that lives inside TRMNL, trmnlp is the better fit.

Quick Start

Just want to see it work? Jump to Try It With the Example Plugin for a copy-paste run with no plugin of your own.

Start your plugin server first. Then run the preview server with the markup URL, bearer token, and user UUID you want to test:

npx trmnl-plugin-preview \
  --target http://localhost:8787/trmnl/markup \
  --token local-preview-token \
  --user-uuid local-preview-user

The preview server launches your default browser automatically when it starts. Use --no-open to keep it in terminal-only mode.

Open:

http://127.0.0.1:4568

When you start the server with --target, --token, and --user-uuid, the workspace opens directly after the endpoint diagnostics pass. If you start the server without connection details, the first screen asks for them before the workspace loads.

Develop From Source

git clone https://github.com/danmunoz/trmnl-plugin-preview.git
cd trmnl-plugin-preview
pnpm install
pnpm run install:browsers
pnpm dev

To pass a target while running from source:

pnpm dev -- \
  --target http://localhost:8787/trmnl/markup \
  --token local-preview-token \
  --user-uuid local-preview-user

Try It With the Example Plugin

Don't have a plugin endpoint yet? The repo ships a tiny, zero-dependency example so you can see the preview working in under a minute. It returns markup for all four views, each drawing a few labelled geometric figures — a clean starting point you can copy for your own endpoint.

The example lives in the source tree (it isn't part of the npm package), so use a source checkout — see Develop From Source. Then run the example endpoint and the preview in two separate terminals (each is a long-running server):

# terminal 1 — the example plugin endpoint (http://localhost:8787)
node examples/shapes/server.mjs
# terminal 2 — the preview, pointed at the example
pnpm dev -- \
  --target http://localhost:8787/trmnl/markup \
  --token local-preview-token \
  --user-uuid local-preview-user

Open http://127.0.0.1:4568 and all four layout variants render. The example's defaults (localhost:8787, token local-preview-token, user local-preview-user) already match the preview's defaults, so pnpm dev with no flags works too.

To change what each slot draws, edit examples/shapes/server.mjs — it's a single file with a FIGURES map and one buildView(...) call per view. See examples/shapes/README.md for the walkthrough and the exact markup contract your own endpoint should return.

What You Need

  • Node.js >=24 <26
  • A TRMNL plugin markup endpoint — or the bundled example to start
  • A bearer token accepted by that endpoint
  • A user UUID for the preview request
  • Chromium for PNG export, installed with npx playwright install chromium

By default, the target URL must be local: localhost, 127.0.0.1, or [::1]. This prevents the preview server from becoming a generic credential relay. To test a remote endpoint that you control, start with --allow-remote-targets. In that mode, the preview server sends your configured bearer token and preview request to the remote URL you provide.

What It Shows

The dashboard renders these four variants at once:

  • full
  • half horizontal
  • half vertical
  • quadrant

Controls let you switch between TRMNL OG and TRMNL X, landscape and portrait, the TRMNL framework font modes, and live HTML or rendered PNG previews. Both device models fit into the same 640-pixel preview stage while preserving their native aspect ratios. Rendered HTML and PNG routes use the selected model's physical device dimensions.

Endpoint diagnostics are available from the workspace status control. They show the target host, HTTP status, response keys, and a redacted curl command.

Common Options

trmnl-plugin-preview \
  --port 4568 \
  --target http://localhost:8787/trmnl/markup \
  --token local-preview-token \
  --user-uuid local-preview-user

To open the workspace from another device on your network, bind the server to the exact address of the network interface you want to expose:

trmnl-plugin-preview --host 192.168.1.20 --port 4568 --no-open

Then open http://192.168.1.20:4568 from the other device. Binding an exact interface address limits the listener to that interface and allows PNG rendering to call back into the same listener.

See Configuration for the full CLI and environment variable reference.

Troubleshooting

The workspace does not open
The preview server validates your endpoint first. Check the error shown on the first screen. The most common causes are wrong bearer token, wrong user UUID, invalid JSON, or missing markup fields.

Remote target rejected
Remote targets are disabled by default. Use --allow-remote-targets only for endpoints you control.

PNG previews fail

Install Chromium with:

npx playwright install chromium

Port already in use
Start on another port:

trmnl-plugin-preview --port 4569

Reference