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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@martinszeltins/vue-component-graph

v1.0.0

Published

Visualize Vue component dependencies (ASCII & HTML)

Downloads

10

Readme

Nuxt Component Graph

Visualize your Vue component dependency graph as an ASCII tree or interactive HTML view.

Installation

# Install locally in your project
npm install @martinszeltins/vue-component-graph

# Or install globally for direct CLI use
npm install -g @martinszeltins/vue-component-graph

Usage

  1. As a library (in code)
import { generateAsciiTree, generateHtmlTree } from '@martinszeltins/vue-component-graph'

async function run() {
    const ascii = await generateAsciiTree({
        root: '/path/to/your-vue-project',
        entry: 'src/App.vue',
        output: 'ascii'
    })

    console.log(ascii)

    const html = await generateHtmlTree({
        root: '/path/to/your-vue-project',
        entry: 'src/App.vue',
        output: 'html'
    })

    // e.g. write html to file:
    // await fs.promises.writeFile('graph.html', html)
}
  1. From the CLI
# If installed locally:
npx @martinszeltins/vue-component-graph --root /home/projects/nuxt-project /home/projects/nuxt-project/components/MyComponent.vue --output=ascii

# If installed globally:
vue-component-graph --root /home/projects/nuxt-project /home/projects/nuxt-project/components/MyComponent.vue --output=ascii

Options

Usage: vue-component-graph [options] <entry>

Generate ASCII or HTML tree of Vue component dependencies.

Arguments:
  entry                   Entry .vue file or directory

Options:
  -r, --root <dir>        Root directory to scan for .vue files  [default: process.cwd()]
  -o, --output <type>     Output format: 'ascii' or 'html'      [default: "ascii"]
  -h, --help              display help for command

Configuration

All you need is:

  • A valid Vue project tree under <root>, with .vue files.
  • An entry component (src/App.vue or any .vue file or directory).

Your graph will include both:

  • Imported components (import { MyComp } from './MyComp.vue')
  • Static <MyComp> tags in template content

Contributing & Support

  • Repo: https://github.com/martinszeltins/vue-component-graph
  • Issues: https://github.com/martinszeltins/vue-component-graph/issues
  • License: MIT

ASCII Output

To generate an ASCII representation of the component dependencies, you can run the following command:

$ npx @martinszeltins/vue-component-graph --root /home/projects/nuxt-project /home/projects/nuxt-project/components/MyComponent.vue --output=ascii

MyComponent.vue
├── app-layout.vue
│   ├── order-load-error.vue
│   │   └── support-button.vue
│   ├── support-button.vue
│   ├── page-info-block.vue
│   ├── app-alert.vue
│   ├── customer-support-modal.vue
│   │   └── customer-support-contacts.vue

HTML Output

To generate an HTML representation of the component dependencies, you can run the following command:

$ npx @martinszeltins/vue-component-graph --root /home/projects/nuxt-project /home/projects/nuxt-project/components/MyComponent.vue --output=html