Files
2023-08-01 13:49:46 +02:00

3.9 KiB

electron-releases

Complete and up-to-date info about every release of Electron.

This package:

Installation

npm i electron-releases

Usage

The module exports an array of release objects:

const releases = require('electron-releases')

// find newest version:
releases[0].tag_name // => 'v1.8.2-beta.3'

// find `latest` on npm, which is not necessarily the most recent release:
releases.find(release => release.npm_dist_tag === 'latest')

// find `beta` on npm:
releases.find(release => release.npm_dist_tag === 'beta')

Data

Each release contains all the data returned by the GitHub Releases API, plus some extra properties:

  • version (String) - the same thing as dist_tag, but without the v for convenient semver comparisons.
  • npm_dist_tag (String) - an npm dist-tag like latest or beta. Most releases will not have this property.
  • npm_package_name (String) - For packages published to npm, this will be electron or electron-prebuilt. For packages not published to npm, this property will not exist.
  • total_downloads (Number) - Total downloads of all assets in the release that have a detectable platform in their filename like .zip, .dmg, .exe, .rpm, .deb, etc.
  • deps (Object) - version numbers for Electron dependencies.
    • v8 (String)
    • chromium (String)
    • node (String)
    • etc..

Updates

This module is self-publishing. It runs in a Heroku Scheduler process every ten minutes. A new version of this module is published if any of the following change:

  • number of Electron releases on GitHub
  • number of Electron releases on npm
  • npm electron@beta version
  • npm electron@latest version

If none of these has changed, the build process aborts and runs again ten minutes later. For more detail, see script/release.sh

The Heroku app is also synced to the GitHub repo, so every push to the master branch will automatically deploy a new version of this app.

Tests

npm install
npm test

Dependencies

None

Dev Dependencies

  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • check-for-leaks: avoid publishing secrets to git and npm
  • dotenv-safe: Load environment variables from .env and ensure they are defined
  • github: NodeJS wrapper for the GitHub API
  • got: Simplified HTTP requests
  • hubdown: Convert markdown to GitHub-style HTML using a common set of remark plugins
  • lodash: Lodash modular utilities.
  • mocha: simple, flexible, fun test framework
  • npm: a package manager for JavaScript
  • parse-link-header: Parses a link header and returns paging information for each contained link.
  • semver: The semantic version parser used by npm.
  • standard: JavaScript Standard Style
  • standard-markdown: Test your Markdown files for Standard JavaScript Style™

License

MIT