Skip to content

Latest commit

 

History

History
94 lines (67 loc) · 5.1 KB

reference.md

File metadata and controls

94 lines (67 loc) · 5.1 KB

Technical reference

Back to the README

Make it yours

Option What it does
-i, --interactive Offers share, clipboard, explanation, and alternatives actions after scanning
--path DIRECTORY Scans a custom folder; repeat for multiple folders; replaces the defaults
-j, --json Emits structured data, with app names but no personal folder paths
--share Prints a summary without app names or paths
--demo Shows fictional results without scanning; works with the interactive menu
-q, --quiet Omits the banner, tips, and MacNative promotion
--no-color Disables colors; NO_COLOR is also respected
-u, --user Compatibility flag; user apps are now included by default
-v, --version Prints the version
-h, --help Shows help
# Scan another app folder
bash electron-detector.sh --path '/Volumes/Work/Applications'

# Save a report for your own tools
bash electron-detector.sh --json > electron-report.json

# Just the findings
bash electron-detector.sh --quiet --no-color

--interactive needs terminal input and output. Use it after downloading, rather than piping the script into Bash. --json and --share are mutually exclusive; --demo cannot be combined with --json or --path.

Questions that come up

Does this tell me which apps are running right now?
No. It inspects installed bundles. Use Activity Monitor for running processes, CPU, and memory.

Is the disk total space I can save?
No. It's the measured size of the detected bundles, including the apps themselves. Replacement apps also use space, and user data is outside this measurement.

It missed an app.
Try --path if it's outside the default folders. Renamed or relocated Electron internals can be missed. Open an issue with the app version and expected marker; please leave personal paths out.

I see a partial-scan warning.
Some folders or bundles couldn't be read. The results describe what was accessible. Try a smaller folder you can read; no admin access is required.

Can I remove it afterward?
Yes. Delete the downloaded script and any report files you saved. There's no installer, background service, or auto-updater.

What a detection means

The detector checks for either:

  • Contents/Frameworks/Electron Framework.framework
  • Contents/MacOS/Electron

These are runtime markers, not a benchmark or an executable signature check. Renamed or relocated frameworks can be missed, and a coincidentally named file can be a false positive. A bundle may include Electron for only part of its functionality. Other web wrappers are outside this tool's scope. No Electron marker does not mean native.

Sizes are allocated bundle disk usage from du -sk, in KiB (displayed as MiB/GiB). They exclude user data and caches. APFS cloning, compression, and shared files can complicate totals. The report does not estimate RAM, battery life, speed, or space you would save by switching. Apps changing during a scan may yield partial measurements. Inaccessible folders are reported as warnings; an empty folder yields a valid zero-app report. Symlink cycles may also cause traversal warnings.

Electron embeds Chromium and Node.js to support cross-platform desktop applications. This is the basis of the report’s “Did you know?” fact. Keep apps that work for you. If you want software with a more native Mac feel, browse MacNative by category. A native app is not necessarily a feature-for-feature replacement.

JSON schema v2

{
  "schema_version": 2,
  "detector_version": "2.1.0",
  "total_apps": 1,
  "electron_count": 1,
  "total_size_kb": 409600,
  "unknown_sizes": 0,
  "scan_warnings": 0,
  "electron_apps": [
    { "name": "Example", "size_kb": 409600, "version": "1.0", "evidence": "Electron Framework.framework" }
  ]
}

size_kb is null when measurement fails. total_size_kb sums known sizes only. total_apps counts bundles with accessible Contents directories. scan_warnings counts traversal diagnostics and inaccessible bundles; it is not a count of missed apps. Version 2 replaces v1's string size with numeric size_kb and includes the user Applications folder by default. Errors go to stderr; JSON stdout stays machine-readable. The demo cannot export JSON, so fictional data cannot be mistaken for a real scan. Exit 0 means the scan completed (inspect warnings); 2 means invalid arguments or an unsupported platform; 1 means temporary workspace creation failed.

Contributing & tests

Use macOS and /bin/bash, not just a newer Homebrew Bash. Runtime dependencies must ship with macOS. Dev tests use Python 3; ShellCheck is optional locally and runs in CI.

/bin/bash -n electron-detector.sh
python3 tests/test_detector.py
shellcheck electron-detector.sh

New detection rules need fixtures for both true and false positives. Don't add telemetry or unmeasured performance claims. Please remove personal information before attaching reports to issues.

MIT license.