electron-fingerprints/README.md

65 lines
2.8 KiB
Markdown
Raw Permalink Normal View History

2022-04-30 10:51:20 +00:00
# [electron-fingerprints](https://github.com/captn3m0/electron-fingerprints/packages/1337118) ![Zero Dependencies](https://img.shields.io/badge/Dependencies-Zero-blue) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/captn3m0/electron-fingerprints) ![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/captn3m0/electron-fingerprints) ![GitHub repo size](https://img.shields.io/github/repo-size/captn3m0/electron-fingerprints)
2021-07-15 18:20:42 +00:00
2022-03-31 07:59:32 +00:00
Generates fingerprints for electron version detection by downloading electron releases and generating checksums (sha1 hashes) of the files contained in each release. Published as a lookup table on the GitHub NPM Registry.
2021-07-15 18:20:42 +00:00
## why
2021-12-19 09:32:43 +00:00
You can use this to guess which electron version is being used in a given application.
2021-07-15 18:20:42 +00:00
A given electron version is (almost always) tightly bound to a node and chrome release as well, so
you get a better sense of what the application is running.
Written as the backend for [`which-electon`][we].
2021-07-16 07:21:49 +00:00
## install
2022-03-31 07:59:32 +00:00
See [the GitHub documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#installing-a-package) to configure the GitHub Packages NPM Registry.
Install from the command line:
2021-07-16 07:21:49 +00:00
```shell
2022-04-30 15:58:26 +00:00
npm install @captn3m0/electron-fingerprints
2022-03-31 07:59:32 +00:00
```
Install via package.json:
```json
2022-04-30 15:58:26 +00:00
"@captn3m0/electron-fingerprints": "*"
2021-07-16 07:21:49 +00:00
```
2021-07-15 18:20:42 +00:00
## usage
2022-04-30 15:58:26 +00:00
This repository only contains the raw data files, see [which-electron][we] for a usable package. The `lookup.json` files are published as the `@captn3m0/electron-fingerprints` package on the GitHub NPM Package Registry as well as on [GitHub Releases][releases]. Programmatic usage is still possible:
2021-07-16 07:21:49 +00:00
```javascript
2022-04-16 13:07:13 +00:00
const lookup = require("@captn3m0/electron-fingerprints");
2021-07-16 07:21:49 +00:00
// baf786083f482c1f035e50e105b5f7475af1e00b = sha1(ffmpeg.dll)
2021-12-19 09:32:43 +00:00
lookup["win32-x64"]["baf786083f482c1f035e50e105b5f7475af1e00b"];
2021-07-16 07:21:49 +00:00
// ["v1.4.3", "v1.4.4", "v1.4.5"]
```
2022-04-30 04:21:54 +00:00
You can sort or filter the returned versions if needed. If you'd like to access the raw data, see `HACKING.md` for a schema description. If you'd like to use this in a project that doesn't use NPM, you can use this repository as a git submodule and track the `main` branch for updates.
2021-07-15 18:20:42 +00:00
2021-07-15 21:00:27 +00:00
## supported releases
2021-12-19 09:32:43 +00:00
All _Stable_ electron releases for the following architectures are fingerprinted:
2021-07-15 21:00:27 +00:00
2022-03-31 07:59:32 +00:00
- `linux-x64`
- `linux-arm64`
- `darwin-x64` (Mac OS)
- `win32-x64` (Windows)
- `win32-arm64` (Windows)
- `darwin-arm64` (Apple Silicon)
2021-07-15 21:00:27 +00:00
2021-11-24 09:21:46 +00:00
A list of release fingerprints is under the `hashes` directory. Releases made when Electron was still called `atom-shell` are not supported (Before April 2015).
2021-07-15 21:00:27 +00:00
2021-12-19 09:32:43 +00:00
## versioning
2022-04-30 15:58:26 +00:00
Releases are versioned by the date on which they were made (as per UTC).
2021-07-16 07:21:49 +00:00
## license
2021-07-15 18:20:42 +00:00
Released under WTFPL.
2021-11-24 09:21:46 +00:00
[we]: https://github.com/captn3m0/which-electron
2022-04-30 15:58:26 +00:00
[releases]: https://github.com/captn3m0/electron-fingerprints/releases