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

sf-dependency-analyzer

v1.0.0

Published

Salesforce Metadata Component Dependency Analyzer CLI

Readme

Salesforce Metadata Component Dependency Analyzer

A powerful Node.js CLI tool to analyze and visualize Salesforce MetadataComponentDependency relationships with a beautiful dark-themed UI.

Features

  • 📊 Query all metadata component dependencies from your Salesforce org
  • 🔍 Find specific component dependencies by name and namespace
  • 🎨 Beautiful dark-themed HTML UI with Tailwind CSS
  • 🔢 Column sorting, pagination, and search functionality
  • 💾 Export results to CSV
  • ⚡ Fast and easy to use

Screenshots

List

Find

Prerequisites

  • Node.js >= 14.0.0
  • Salesforce CLI (sf) installed and configured
  • Authenticated Salesforce org

Installation

npm install -g sf-dependency-analyzer

Usage

Command 1: List All Dependencies

List all metadata component dependencies from your Salesforce org:

sf-meta-dep list -o <username>

Example:

sf-meta-dep list -o [email protected]
# or with alias
sf-meta-dep list -o myDevOrg

Command 2: Find Component Dependencies

Find dependencies for a specific metadata component:

sf-meta-dep find -o <username> -c <ComponentName> [-n <namespace>]

Options:

  • -o, --org <username> - Salesforce org username or alias (required)
  • -c, --component <name> - Metadata component name (required)
  • -n, --namespace <namespace> - Metadata component namespace (optional, default: empty)

Examples:

# Find dependencies for a component without namespace
sf-meta-dep find -o [email protected] -c AccountController

# Find dependencies for a component with namespace
sf-meta-dep find -o myDevOrg -c CustomObject -n MyNamespace

Output

The tool generates an HTML file with:

  • Interactive Data Table - All dependencies displayed in a clean, sortable table
  • Search - Filter dependencies in real-time
  • Sorting - Click column headers to sort
  • Pagination - Navigate through large datasets (50 rows per page)
  • CSV Export - Download filtered results as CSV
  • Dark Theme - Easy on the eyes with professional styling

The HTML file will:

  1. Be saved in your current directory
  2. Automatically open in your default browser

HTML UI Features

Search

Type in the search box to filter dependencies across all columns in real-time.

Column Sorting

Click any column header to sort by that column. Click again to reverse the sort order.

Pagination

Navigate through pages using Previous/Next buttons. Shows current page and total entries.

CSV Export

Click the "Export CSV" button to download the current filtered results as a CSV file.

Columns Displayed

  • Component Name
  • Namespace
  • Type
  • Referenced Component Name
  • Referenced Namespace
  • Referenced Type

How It Works

  1. Authenticates with your Salesforce org using SF CLI
  2. Queries the MetadataComponentDependency object
  3. Filters results (if using find command)
  4. Generates a standalone HTML file with embedded data
  5. Opens the report in your default browser

Troubleshooting

SF CLI Not Found

Ensure Salesforce CLI is installed:

sf --version

Authentication Issues

Make sure you're authenticated to the org:

sf org display -o <username>

No Dependencies Found

  • Verify the component name is correct (case-sensitive)
  • Check if the component exists in your org
  • Ensure you have proper permissions to access MetadataComponentDependency

Technical Details

  • Built with Node.js and Commander.js
  • Uses SF CLI for Salesforce interactions
  • Generates standalone HTML with Tailwind CSS
  • No external dependencies for the HTML viewer
  • All data embedded in the HTML file for portability

License

MIT (c) Mohan Chinnappan