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

sf-bulk-delete

v1.0.9

Published

Salesforce Bulk Delete Tool with Web UI

Readme

Salesforce Bulk Delete Tool

A powerful Node.js CLI tool with a beautiful web interface for bulk deleting Salesforce records using the Salesforce CLI.

Features

  • 🎨 Beautiful Dark/Light Theme UI with Tailwind CSS
  • 📊 Three-Panel Layout with resizable splitters
  • 🔍 Advanced Data Table with search, sorting, and pagination
  • 📁 Multiple Object Support via load-plan.json
  • Bulk Selection with checkbox management
  • 📥 CSV Export functionality
  • ⚠️ Safe Deletion with confirmation dialogs
  • 📈 Real-time Job Monitoring with success/failure reports
  • 🔄 Auto-refresh job status polling

Screenshots

  • sf-delete-1
  • sf-delete-2
  • sf-delete-3

Prerequisites

  • Node.js 14.x or higher
  • Salesforce CLI (sf) installed and configured
  • Authenticated Salesforce org

Installation


npm install -g sf-bulk-delete 

Usage

Start the Web Server


sf-bulk-delete start -o [email protected]  \
-p 7070 \
-l ./load-plans/load-plan-account.json

Command Options

  • -o, --org <username> - Required: Salesforce org username or alias
  • -p, --port <number> - Port number for web server (default: 3000)
  • -l, --load-plan <file> - Path to load-plan.json (default: load-plan.json)

Example

Load Plan Configuration

The load-plan.json file defines the Salesforce objects and queries for deletion. Here's the format:

[
  {
    "object": "Account",
    "compositeKeys": [
      "Id"
    ],
    "query": "SELECT  Name FROM Account",
    "fieldMappings": {
      "Name": "Name",
      "Id": "Id"
    }
  }
]

Another exmple:

[
  {
    "object": "Fruit__c",
    "compositeKeys": [
      "External_Id__c"
    ],
    "query": "SELECT Name, Qty__c,External_Id__c FROM Fruit__c",
    "fieldMappings": {
      "Name": "Name",
      "Qty__c": "Qty__c",
      "External_Id__c": "External_Id__c"
    }
  }
]

Load Plan Structure

Web Interface Guide

Left Panel - Objects List

  • Displays all objects from load-plan.json
  • Click an object to load its query
  • Active object is highlighted

Center Panel - Query & Results

  1. Query Editor: View and edit SOQL queries, auto-completes with fields for the selected object
  2. Execute Button: Run the query (inserts Id field if not provided)
  3. Search Box: Filter results in real-time
  4. Data Table:
    • Click column headers to sort
    • Select records with checkboxes
    • Hover for row highlighting
  5. Pagination Controls: Navigate through large result sets
  6. Export CSV: Download filtered results
  7. Delete Selected: Initiate bulk delete operation

Right Panel - Job Results

  • Shows active and completed deletion jobs
  • Real-time status updates
  • Success/failure record lists
  • Detailed job information

Deletion Workflow

  1. Select Object: Click an object in the left panel
  2. Execute Query: Click "Execute Query" to fetch records
  3. Filter/Search: Optionally filter records
  4. Select Records: Use checkboxes to select records for deletion
  5. Initiate Delete: Click "Delete Selected"
  6. Confirm: Review and confirm the deletion warning
  7. Monitor: Watch the job progress in the right panel
  8. Review Results: Check success/failure reports

API Endpoints

The tool exposes the following REST API endpoints:

  • GET /api/objects - Get all objects from load-plan
  • POST /api/query - Execute SOQL query
  • POST /api/delete - Delete records
  • GET /api/results/:jobId - Get job results

Safety Features

  • ⚠️ Confirmation Dialog: Always prompts before deletion
  • 🔍 Record Preview: Shows exactly what will be deleted
  • 📊 Job Tracking: Monitor deletion progress
  • 📝 Result Reports: Detailed success/failure logs
  • 🛡️ Error Handling: Graceful error messages

Technical Details

Bulk Delete Process

  1. Tool creates a CSV file with record IDs
  2. Executes: sf data delete bulk --sobject <object> --file <csv> --wait 20 --target-org <org>
  3. Polls job status every 5 seconds
  4. Retrieves success/failure CSV files
  5. Displays results in UI

Troubleshooting

"Command not found: sf"

  • Install Salesforce CLI: npm install -g @salesforce/cli

"No default org found"

  • Authenticate: sf org login web -a myorg
  • Specify org with -o flag

Port already in use

  • Use a different port: -p 8080

Records not appearing

  • Check org authentication
  • Review query filters

License

MIT (c) Mohan Chinnappan


⚠️ Warning: This tool performs permanent deletions. Always verify your selection before confirming deletion operations.