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

@animaapp/vite-plugin-screen-graph

v0.2.4

Published

Vite plugin that generates a graph of screen navigation in React applications

Readme

@animaapp/vite-plugin-screen-graph

A Vite plugin that generates a graph of screen navigation in React applications.

Installation

npm install --save-dev @animaapp/vite-plugin-screen-graph
# or
yarn add --dev @animaapp/vite-plugin-screen-graph
# or
pnpm add -D @animaapp/vite-plugin-screen-graph

Usage

Add the plugin to your vite.config.ts file:

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { screenGraphPlugin } from '@animaapp/vite-plugin-screen-graph';

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

When you build your project, the plugin will analyze your React components and generate a .screen-graph.json file in the root of your project. This file contains a graph representation of your application's screen navigation.

How it works

The plugin analyzes your React components and identifies navigation between screens by looking for:

  • <Link> and <NavLink> components from React Router
  • <Navigate> components from React Router
  • <a> tags with href attributes
  • navigate() function calls from React Router

It then builds a graph where:

  • Nodes represent screens (React components associated with routes)
  • Edges represent navigation paths between screens

Output format

The generated .screen-graph.json file has the following structure:

{
  "nodes": [
    {
      "id": "path/to/HomeScreen.tsx",
      "label": "HomeScreen",
      "isRoot": true
    },
    {
      "id": "path/to/ProfileScreen.tsx",
      "label": "ProfileScreen"
    },
    // ...
  ],
  "edges": [
    {
      "id": "path/to/HomeScreen.tsx:42:10-to-path/to/ProfileScreen.tsx",
      "source": "path/to/HomeScreen.tsx",
      "target": "path/to/ProfileScreen.tsx",
      "data": {
        "viaRoute": "/profile",
        "trigger": {
          "element": "<Link to=\"/profile\">Go to Profile</Link>",
          "line": 42,
          "column": 10,
          "sourceFile": "path/to/HomeScreen.tsx"
        }
      }
    },
    // ...
  ]
}

Node Structure

  • id: The full file path to the component, ensuring uniqueness even if multiple components have the same name
  • label: The component name (basename of the file without extension) for display purposes
  • isRoot: A boolean flag (only present on the root screen) indicating if this is the root screen (path: "/")

Edge Structure

  • id: A unique identifier combining the source location (file, line, column) and target file
  • source: The source node ID (file path)
  • target: The target node ID (file path)
  • data: Additional information about the navigation
    • viaRoute: The route path used for navigation
    • trigger: Information about what triggered the navigation
      • element: The full element snippet that triggered the navigation (e.g., <Link to="/profile">Go to Profile</Link>)
      • line: The line number in the source file
      • column: The column number in the source file
      • sourceFile: The source file path

License

MIT