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

salesforce-metadata-central

v1.0.1

Published

Salesforce Metadata Explorer with Visual Interface - Browse, visualize, and generate SOQL queries for your Salesforce org metadata

Readme

Salesforce Metadata Central

A powerful CLI tool with a beautiful web interface for exploring and visualizing Salesforce metadata.

Features

  • 🔍 Explore Metadata: Browse all Salesforce objects in your org
  • 📊 ERD Visualization: Generate Entity Relationship Diagrams with zoom controls
  • 📋 Schema Export: Export metadata schema to CSV
  • 🎨 Dark Theme UI: Modern, responsive dark-themed interface
  • 🔎 Search & Filter: Real-time search for objects with persistent selections
  • 💊 Selection Pills: Visual pill-based interface for selected objects with easy removal
  • 📈 Interactive Tables: Sort, paginate, search, and export data
  • 🔍 SVG Zoom Controls: Zoom in/out and reset ERD diagrams
  • SOQL Generator: Automatically generate SELECT queries for single objects
  • 📥 One-Click Copy: Copy generated SOQL to clipboard with visual feedback
  • 🔄 Persistent State: Selections maintain across searches and filters

Screenshots

  • ERD

  • Schema

  • SOQL

Prerequisites

  • Node.js (v14 or higher)
  • Salesforce CLI (sf)
  • sf mohanc plugin installed

Installation

npm install -g salesforce-metadata-central

Usage

Start the Web Interface

sf-metadata-central start

Using the Web Interface

  1. Enter Username: Enter your Salesforce username or alias
  2. Load Objects: Click "Load Objects" to fetch all sobjects
  3. Select Objects: Use checkboxes to select objects (multi-select supported)
    • Search for objects while maintaining selections
    • View selected objects in the pill box
    • Click × on any pill to remove that object
    • Use "Select All" or "Clear" buttons for bulk operations
  4. Generate Metadata: Click "Generate Metadata" to create ERD and schema
  5. View Results:
    • ERD Section: View, zoom (in/out/reset), and save SVG diagrams
    • Schema Table: Search, sort, paginate, and export CSV data
  6. Generate SOQL (when 1 object selected):
    • Click "Generate SOQL" button
    • View formatted SOQL query in modal
    • Copy to clipboard with one click

Key Features Explained

Smart Object Selection

  • Persistent Selections: Your selections remain intact when searching or filtering
  • Visual Pills: Selected objects appear as removable pills at the top
  • Global State Management: Selections are tracked independently of the DOM
  • Easy Removal: Click the × button on any pill to unselect that object

SOQL Query Generator

  • Automatically generates properly formatted SELECT queries
  • Lists all fields alphabetically
  • Formats output with 4 fields per line
  • One-click copy to clipboard with visual confirmation
  • Only available when exactly 1 object is selected

Search & Filter

  • Real-time object search in the left pane
  • Table search across all columns
  • Selections persist across all search operations
  • Clear visual feedback for active searches

API Endpoints

GET /api/sobjects/:username

Get list of all sobjects from Salesforce org.

Response:

{
  "success": true,
  "sobjects": ["Account", "Contact", "Lead", ...]
}

POST /api/describe

Generate ERD and schema CSV for selected objects.

Request:

{
  "username": "[email protected]",
  "sobjects": ["Account", "Contact"]
}

Response:

{
  "success": true,
  "svg": "<svg>...</svg>",
  "csv": "sobjectName,sobjectLabel,...",
  "svgFilename": "erd_1234567890.svg",
  "csvFilename": "schema_1234567890.csv"
}

Technical Highlights

State Management

  • Global selectedObjects Set maintains selection state
  • Decoupled from DOM for reliability
  • Survives filter operations and re-renders
  • Single source of truth for all operations

User Experience

  • Visual feedback for all actions (copy, save, selection)
  • Smooth animations for pills and transitions
  • Responsive design for all screen sizes
  • Dark theme optimized for long sessions

Code Architecture

The frontend uses:

  • Global state for selections (selectedObjects Set)
  • Event-driven updates via requestAnimationFrame
  • Pure render functions that safely re-render without side effects
  • Separation of concerns between state, DOM, and API

Troubleshooting

Command Not Found

Ensure Salesforce CLI and the mohanc plugin are installed:

sf plugins

Port Already in Use

Use a different port:

node bin/cli.js start --port 8080

Browser Compatibility

  • Chrome 90+
  • Firefox 88+
  • Safari 14+
  • Edge 90+

Requires modern browser with support for:

  • ES6+ JavaScript
  • Clipboard API
  • CSS Grid & Flexbox

License

MIT (c) Mohan Chinnappan

Roadmap

  • [ ] Export ERD to PNG/PDF
  • [ ] Save/Load selection presets
  • [ ] Bulk SOQL generation for multiple objects
  • [ ] Field-level relationship visualization
  • [ ] Dark/Light theme toggle
  • [ ] Keyboard shortcuts
  • [ ] Object metadata comparison