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

b2c-plugin-help-docs-viewer

v0.4.0

Published

B2C CLI plugin for Salesforce Help search and article details.

Readme

B2C Plugin: Salesforce Help Search

Search Salesforce Help and fetch Help/Developer docs details with caching and secure token storage.

Highlights:

  • Search Salesforce Help with boxed, column-aligned results.
  • Fetch a single Help or Developer docs page by URL or by ID from the latest search.
  • Fetch search results + content in one command (supports Help and Developer docs URLs).
  • Direct URL fetching is restricted to https://help.salesforce.com and https://developer.salesforce.com.
  • Batch fetch uses bounded concurrency and reports per-URL failures instead of failing fast.
  • Cached results are reused for up to 5 days (opt out with --no-cache).

Install (npm)

b2c plugins install b2c-plugin-help-docs-viewer

If Playwright Chromium is not installed yet:

npx playwright install chromium

Install (local development)

npm install
npx playwright install chromium
npm run build
b2c plugins link /path/to/b2c-plugin-help-docs-viewer

Usage

Command overview:

  • b2c docs search-help-site <query>: Search Help and return a boxed table.
  • b2c docs help-site-article <url|id>: Fetch a Help or Developer docs page by URL or by ID.
  • b2c docs fetch-results-help-site <query>: Search and immediately fetch content.

Search for articles:

b2c docs search-help-site "b2c commerce roles" --limit 5

Fetch article details (use a URL or a result ID from the latest search):

b2c docs help-site-article "https://help.salesforce.com/s/articleView?id=cc.b2c_roles_and_permissions.htm&type=5"
b2c docs help-site-article 2
b2c docs help-site-article 2 --json --raw-html

Search and immediately fetch details:

b2c docs fetch-results-help-site "b2c commerce roles" --limit 3
b2c docs fetch-results-help-site "b2c commerce roles" --limit 6 --concurrency 3

Examples

Search with JSON output:

b2c docs search-help-site "pipelines" --limit 3 --json

Search and fetch in one step (save to a file):

b2c docs fetch-results-help-site "pipelines" --limit 3 --out ./artifacts/pipelines.md

Fetch by ID from the latest search:

b2c docs search-help-site "pipelines" --limit 5
b2c docs help-site-article 2

Fetch markdown plus raw extracted HTML (writes sidecar file):

b2c docs help-site-article 2 --out ./artifacts/article.md --raw-html
# writes:
# - ./artifacts/article.md
# - ./artifacts/article.md.raw.html

Boxed search output (example):

+----+------------------------------------------------------------+------------------------------------------------------------------+
| #  | Title                                                      | URL                                                              |
+----+------------------------------------------------------------+------------------------------------------------------------------+
| 01 | Pipeline overview                                          | https://help.salesforce.com/s/articleView?id=example.htm&type=5  |
+----+------------------------------------------------------------+------------------------------------------------------------------+
| 02 | Configure pipeline steps                                   | https://help.salesforce.com/s/articleView?id=example2.htm&type=5 |
+----+------------------------------------------------------------+------------------------------------------------------------------+

Use the ID shortcut with a leading #:

b2c docs help-site-article #3

Caching

  • Search and detail results are cached under the system temp directory.
  • Cached items are reused for up to 5 days.
  • Use --no-cache to force a fresh network fetch and parsing pass. In this mode cache files are neither read nor written.

Testing

  • Run unit tests once: npm test
  • Run tests in watch mode: npm run test:watch

Regression suite (real pages)

  • Fixture list: testing/regression/fixtures.json
  • Scrape + compare against baseline: npm run regression:suite
  • Refresh baseline from latest scrape: npm run regression:promote
  • Fail on drift (CI mode): npm run regression:check

Notes:

  • The regression scripts use dist/lib/helpScraper.js, so run npm run build first.
  • The regression suite config/scripts are tracked in git under testing/regression/.
  • Current run outputs are written to testing/regression/current/.
  • Baseline snapshots are stored in testing/regression/baseline/.
  • Comparison report: testing/regression/current/report.json.

Output formats

  • Default output is a boxed table for search results and markdown for article content.
  • Use --json to emit structured JSON for automation and AI workflows.
  • Use --raw-html with docs help-site-article to include raw extracted HTML in --json output or to write a .raw.html sidecar when using --out.

Troubleshooting

  • If Playwright is missing a browser, run npx playwright install chromium.
  • If keychain access is blocked, allow your terminal to access the keychain and retry.

Notes

  • Tokens are stored in the OS keychain (via keytar).
  • The CLI uses Playwright for Help site rendering; install the Chromium browser if needed.

Unlink

b2c plugins unlink b2c-plugin-help-docs-viewer