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

@fredsvanelli/frontpeek

v0.4.0

Published

Click any element in your running React/Next app to jump to its source — or copy the component path / an AI prompt. A floating toolbar that works standalone, and opens VS Code when the companion extension is running.

Readme

@fredsvanelli/frontpeek

A floating dev toolbar for React / Next.js apps. Click any element in your running app to jump to its source, tweak its styles, or turn it into an AI prompt.

The FrontPeek toolbar

Three tools, one click away:

  • Code: jump to the element's source file. If the FrontPeek editor extension (VS Code Marketplace · Open VSX) is running, it opens the exact file/line in your editor. If not, the component path is copied to your clipboard.
  • Edit: tweak an element's styles in a live editor and copy the change as a ready-to-paste AI prompt.
  • Prompt: click an element, describe a change, and copy a structured prompt that already points at the right file and JSX.

Pick the exact element you meant

A click rarely has just one valid target. The element sits inside a whole component hierarchy (Routes > Page > List > p), and your intent may live at any level of it. So after you click, all three tools open a small picker listing the deepest levels of that hierarchy; choose the one you meant and it is resolved. Click […] at the top to reveal more ancestors, hover a row to highlight what it covers on the page.

The component hierarchy picker, showing four levels of the clicked element's ancestry

Edit styles live, copy the diff as a prompt

The Edit tool opens an inspector grouped into Layout, Size, Text, Colors, and Border tabs. Changes preview live on the page; hit Copy Prompt to grab the change as text you can paste into any AI assistant.

The live CSS editor with Layout, Size, Text, Colors and Border tabs

Describe a change in plain words

The Prompt tool skips the styling UI entirely: click an element, describe the change you want, and copy a structured prompt that already points at the right file and JSX.

The prompt box: describe a change and copy it as a structured prompt

The toolbar is self-contained, it needs no browser extension and no proxy. Source resolution runs in the browser against your own dev server, so it works at your app's real origin.

Install

npm install @fredsvanelli/frontpeek

react (>=17) is a peer dependency.

Usage

Drop <FrontPeek /> once, near the root of your app.

Next.js (App Router) - app/layout.tsx

import { FrontPeek } from '@fredsvanelli/frontpeek';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <FrontPeek />
      </body>
    </html>
  );
}

React (Vite / CRA)

import { FrontPeek } from '@fredsvanelli/frontpeek';

function App() {
  return (
    <>
      {/* your app */}
      <FrontPeek />
    </>
  );
}

Choosing where it shows

By default FrontPeek renders only in local development (process.env.NODE_ENV === 'development').

To control it explicitly, pass the enabled boolean. You decide the condition, so any environment scheme works (Vercel, custom NEXT_PUBLIC_* vars, staging/preview, custom strings like prod / stg):

// show everywhere except production
<FrontPeek enabled={process.env.NEXT_PUBLIC_APP_ENV !== 'production'} />

// show on an explicit allow-list of environments
<FrontPeek enabled={['development', 'staging', 'prod'].includes(process.env.NEXT_PUBLIC_APP_ENV)} />

// force off
<FrontPeek enabled={false} />

Environment variables are inlined at build time, so gate on ones your bundler exposes to the browser (e.g. NEXT_PUBLIC_* in Next).

Props

| Prop | Type | Default | Description | | ------------ | --------- | ---------------------------------------- | ------------------------------------------------------------------ | | enabled | boolean | NODE_ENV === 'development' when omitted | Whether the toolbar mounts. Explicit boolean always wins. | | bridgePort | number | 57420 | Loopback port the VS Code extension listens on. Change only if you customized the extension. |

Open-in-editor (optional, but very recommended!)

Clicking Code copies the path by default. To have it open your editor instead, install the companion FrontPeek extension from the store that matches your editor:

| Editor | Where to install | | --- | --- | | VS Code | VS Code Marketplace | | VSCodium, Cursor, Windsurf and other forks | Open VSX |

The extension runs a tiny local bridge on localhost:57420; when detected, the toolbar's status dot turns green and Code opens the file at the exact line. Nothing else about the toolbar changes.

The status dot tells you which mode you're in, amber when the toolbar is on its own (clipboard), green when the extension is connected (open-in-editor):

| Standalone (clipboard) | Extension connected (open-in-editor) | | ---------------------- | ------------------------------------ | | Toolbar with an amber status dot | Toolbar with a green status dot |

Green dot, but still not working?

Sometimes port 57420 is already in use by another process (maybe a duplicate FrontPeek instance). When that happens, the extension's bridge falls back to a random free port.

To find out which port the bridge actually got, run the FrontPeek: Show Output command in your editor (Command Palette) and look for the message reporting the random port. Then pass that port to the toolbar:

<FrontPeek bridgePort={51234} />

// or

<FrontPeek bridgePort={process.env.FRONTPEEK_PORT} /> {/* easier to switch ports */}

Once both sides agree on the port, Code will open files in your editor again.

License

MIT