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

load-plan-query-validator

v1.0.1

Published

Load Plan Query Validator is a command-line tool that validates load plan queries against a predefined schema. It ensures that the queries are correctly structured and adhere to the expected format, helping developers identify and fix issues before execut

Readme

🚀 Load Plan Query Validator

Load Plan Query Validator is a Node.js command-line tool that validates SOQL queries defined inside a Salesforce load plan file by executing them against a target org using the Salesforce CLI.

It helps you detect:

  • ❌ Invalid fields
  • ❌ Missing objects
  • ❌ Relationship errors
  • ❌ Syntax issues
  • ❌ Schema mismatches

Before running any actual data migration or load process.


📦 Installation

npm install -g load-plan-query-validator

Running

load-plan-query-validator --help

⚙️ Requirements


🧠 How It Works

The tool:

  1. Reads load-plan.json
  2. Extracts each object’s query
  3. Executes:
sf data query -u <org> -q "<SOQL>" --json
  1. Captures success or error

  2. Prints a summary report

  3. Returns:

    • 0 → All queries valid
    • 1 → At least one query failed

🏃 Usage

load-plan-query-validator \
  -o <salesforce-username-or-alias> \
  -l <load-plan.json>

Example

load-plan-query-validator -o ea11 -l load-plan.json

📄 Example load-plan.json Entry

{
  "object": "Product2",
  "compositeKeys": ["StockKeepingUnit"],
  "query": "SELECT StockKeepingUnit, Name, ProductCode FROM Product2",
  "fieldMappings": {
    "StockKeepingUnit": "StockKeepingUnit",
    "Name": "Name",
    "ProductCode": "ProductCode"
  }
}

📊 Example Output

🔍 Validating queries against org: devhub

→ Checking: AttributeCategory
   ✔ Query OK (12 records)

→ Checking: Product2
   ✖ Query Failed
     No such column 'InvalidField__c' on entity 'Product2'.

====================================
📊 Validation Summary
====================================
✔ Successful Queries: 24
✖ Failed Queries: 1

❌ Error Details:

1. Object: Product2
   Query: SELECT InvalidField__c FROM Product2
   Error: No such column 'InvalidField__c' on entity 'Product2'.

🔎 What This Tool Catches

  • Missing fields
  • Misspelled relationship paths
  • Invalid lookup references
  • Non-existent objects
  • Permission-related query failures
  • Schema drift between orgs

🎯 Why Use This?

Before running:

  • Data migrations
  • CPQ configuration loads
  • Industry Cloud deployments
  • Metadata-driven imports
  • CI/CD validation

This tool ensures your queries are safe and valid.


🛠 CLI Options

| Option | Description | | ------------------------ | -------------------------------- | | -o, --org <username> | Salesforce org username or alias | | -l, --load-plan <file> | Path to load-plan.json |


🧾 Exit Codes

| Code | Meaning | | ---- | -------------------------- | | 0 | All queries valid | | 1 | One or more queries failed |

This makes it CI/CD friendly.


💡 Future Enhancements (Planned)

  • Parallel execution
  • Markdown error report export
  • CSV export
  • Duplicate object detection
  • Dependency graph visualization
  • CI GitHub Action template
  • Schema comparison mode

📜 License

MIT License © Mohan Chinnappan