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

@bakdotdev/dev-tools

v1.1.19

Published

Click-to-source development tool for React, Vue, and Angular. Inspect elements, open source files in your editor, or copy LLM-friendly snippets.

Readme

@bakdotdev/dev-tools

Click-to-source development tool. Inspect any element, open its source file in your editor, or copy an LLM-friendly snippet to your clipboard.

npm version GitHub

Features

  • Click-to-source — Ctrl+Click any element to open its source file in your editor
  • LLM snippets — Cmd+Click to copy formatted code snippets for AI assistants
  • Parent navigation — Hold Alt to target the parent component instead
  • Visual inspector — Crosshairs, element badges, and file path display
  • Toggle highlighting — Switch button to enable/disable visual overlay
  • Settings UI — Configure editor and modifier key location via gear icon
  • Framework support — React, Vue 3, Angular 17+, Next.js, Nuxt 3, TanStack Start
  • Editor support — VS Code, Cursor, Zed

Installation

pnpm add @bakdotdev/dev-tools

React + Vite

1. Add the Vite plugin:

// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { devToolsPlugin } from "@bakdotdev/dev-tools/vite-plugin";

export default defineConfig({
  plugins: [devToolsPlugin(), react()],
});

2. Initialize the overlay:

// main.tsx
import { initClickToSource } from "@bakdotdev/dev-tools";

// Editor options: "vscode" (default) | "cursor" | "zed"
initClickToSource();
initClickToSource({ editorProtocol: "cursor" }); // for Cursor
initClickToSource({ editorProtocol: "zed" });    // for Zed

Or use the React component:

import { ClickToSource } from "@bakdotdev/dev-tools/react";

function App() {
  return (
    <>
      <YourApp />
      {/* editorProtocol: "vscode" (default) | "cursor" | "zed" */}
      <ClickToSource />
    </>
  );
}

Usage

| Shortcut | Action | |----------|--------| | Ctrl + Click | Open element's source in editor | | Ctrl + Alt + Click | Open parent component's source in editor | | Cmd + Click | Copy element as LLM-friendly snippet | | Cmd + Alt + Click | Copy parent component as LLM-friendly snippet |

The overlay displays controls at the bottom:

  • Toggle switch — Enable/disable visual highlighting (keyboard shortcuts remain active)
  • Settings button (gear icon) — Opens a dialog to configure:
    • Editor — Choose between VS Code, Cursor, or Zed
    • Modifier Keys — Left side only, right side only, or both sides

Settings are persisted to localStorage and will be remembered across sessions.

LLM Snippet Format

When copying with Cmd+Click, the snippet is formatted for optimal LLM parsing:

<code source="/path/to/file.tsx:42:8">
<div class="example">
  <span>Content</span>
</div>
</code>

The source attribute contains file:line:column. This format works across all major LLMs (Claude, GPT, Gemini, etc.).

Editor Protocols

| Editor | Protocol | |--------|----------| | VS Code | "vscode" (default) | | Cursor | "cursor" | | Zed | "zed" |

Other Frameworks

Next.js (Turbopack)

// next.config.ts
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  turbopack: {
    rules: {
      "*.tsx": {
        loaders: [
          {
            loader: "@bakdotdev/dev-tools/webpack-loader",
            options: { env: "development" },
          },
        ],
      },
      "*.jsx": {
        loaders: [
          {
            loader: "@bakdotdev/dev-tools/webpack-loader",
            options: { env: "development" },
          },
        ],
      },
    },
  },
};

export default nextConfig;

Add the React component to your root layout:

// app/layout.tsx
import { ClickToSource } from "@bakdotdev/dev-tools/react";

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <ClickToSource editorProtocol="vscode" />
      </body>
    </html>
  );
}

Next.js (Webpack)

For Next.js without Turbopack:

// next.config.js
module.exports = {
  webpack: (config, { dev }) => {
    if (dev) {
      config.module.rules.push({
        test: /\.(tsx|jsx)$/,
        exclude: /node_modules/,
        use: [
          {
            loader: "@bakdotdev/dev-tools/webpack-loader",
            options: { env: "development" },
          },
        ],
      });
    }
    return config;
  },
};

TanStack Start

// app.config.ts
import { defineConfig } from "@tanstack/start/config";
import { devToolsPlugin } from "@bakdotdev/dev-tools/vite-plugin";

export default defineConfig({
  vite: {
    plugins: [devToolsPlugin()],
  },
});
// app/client.tsx
import { initClickToSource } from "@bakdotdev/dev-tools";

initClickToSource({ editorProtocol: "vscode" });

Vue 3

// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { devToolsPlugin } from "@bakdotdev/dev-tools/vite-plugin";

export default defineConfig({
  plugins: [devToolsPlugin(), vue()],
});
<script setup>
import { useClickToSource } from "@bakdotdev/dev-tools/vue";

useClickToSource({ editorProtocol: "vscode" });
</script>

Nuxt 3

// nuxt.config.ts
import { devToolsPlugin } from "@bakdotdev/dev-tools/vite-plugin";

export default defineNuxtConfig({
  vite: {
    plugins: [devToolsPlugin()],
  },
});

Angular 17+

// vite.config.ts (Angular uses Vite by default in v17+)
import { devToolsPlugin } from "@bakdotdev/dev-tools/vite-plugin";

export default {
  plugins: [devToolsPlugin()],
};
// app.component.ts
import { Component, OnInit } from "@angular/core";
import { initClickToSource } from "@bakdotdev/dev-tools";

@Component({ ... })
export class AppComponent implements OnInit {
  ngOnInit() {
    initClickToSource({ editorProtocol: "vscode" });
  }
}

Plugin Options

devToolsPlugin({
  // Environments to enable (default: ["development"])
  environments: ["development"],

  // Components to skip
  ignoreComponentNames: ["InternalComponent"],

  // File patterns to include
  include: [/\.[jt]sx?$/, /\.vue$/, /\.component\.html$/],

  // File patterns to exclude
  exclude: [/node_modules/, /\.test\./],
});

API

initClickToSource(options?)

Initialize the overlay. Returns a cleanup function.

const cleanup = initClickToSource({
  editorProtocol: "vscode",
  modifierLocation: "any", // "any" | "left" | "right"
});

cleanup(); // Remove overlay

modifierLocation Option

Control which modifier keys (Ctrl, Cmd, Alt) activate the tool:

| Value | Description | |-------|-------------| | "left" (default) | Only respond to left-side modifier keys | | "right" | Only respond to right-side modifier keys | | "any" | Respond to both left and right modifier keys |

This is useful when you want to reserve one side of the keyboard for other shortcuts. For example, use "right" to only activate the tool with right-Ctrl/Cmd, leaving left-Ctrl/Cmd free for browser shortcuts.

Note: This can also be changed at runtime via the settings UI (gear icon).

setEditorProtocol(protocol)

Change editor at runtime.

import { setEditorProtocol } from "@bakdotdev/dev-tools";

setEditorProtocol("vscode");

isOverlayActive()

Check if overlay is mounted.

import { isOverlayActive } from "@bakdotdev/dev-tools";

if (isOverlayActive()) {
  console.log("Dev tools active");
}

Requirements

  • Node.js 18+
  • Vite 5+ or webpack-compatible bundler
  • React 18+, Vue 3+, or Angular 17+

Follow for more stuff!

License

MIT