which-electron/README.md

1.3 KiB

which-electron

Try to find out which Electron version is bundled inside an application.

Usage

$ npm install which-electron
$ which-electron Google.Play.Music.Desktop.Player.OSX.zip
Version Constraint: <v7.0.0
Multiple guesses from fingerprinting:
[
  'v3.1.10', 'v3.1.11',
  'v3.1.12', 'v3.1.13',
  'v3.1.5',  'v3.1.6',
  'v3.1.7',  'v3.1.8',
  'v3.1.9'
]

$ which-electron HashTag-win32-x64.zip
Found Version file: v7.1.10
Fingerprint: v7.1.10

$ which-electron Google.Play.Music.Desktop.Player.deb

How does it work?

We attempt multiple pathways:

  1. The presence of a electron.asar file denotes an electron version <v7.0.0, since later releases dropped that file and embedded it in the binary instead.
  2. A version text file is sometimes included in the final binary.
  3. The node_modules/electron/package.json file is sometimes present.
  4. A lookup table of hashes from various electron releases is used to guess the version. (WIP)
  5. Get the electron version from the electron binary (WIP)

Note that this can be run against untrusted binaries as it does not try to run the application.

License

Licensed under the MIT License. See LICENSE file for details.