{"id":15717964,"url":"https://github.com/megahertz/electron-simple-updater","last_synced_at":"2025-04-13T07:47:35.359Z","repository":{"id":53784177,"uuid":"70801087","full_name":"megahertz/electron-simple-updater","owner":"megahertz","description":"Simple way to enable update for the electron application","archived":false,"fork":false,"pushed_at":"2022-09-01T13:34:45.000Z","size":665,"stargazers_count":367,"open_issues_count":2,"forks_count":75,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T15:17:53.867Z","etag":null,"topics":["electron","linux","macos","squirrel","update","windows"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/megahertz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-13T11:47:34.000Z","updated_at":"2025-01-06T10:12:01.000Z","dependencies_parsed_at":"2022-09-02T08:51:13.901Z","dependency_job_id":null,"html_url":"https://github.com/megahertz/electron-simple-updater","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Felectron-simple-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Felectron-simple-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Felectron-simple-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/megahertz%2Felectron-simple-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/megahertz","download_url":"https://codeload.github.com/megahertz/electron-simple-updater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128747,"owners_count":20888235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electron","linux","macos","squirrel","update","windows"],"created_at":"2024-10-03T21:51:47.981Z","updated_at":"2025-04-04T06:06:02.919Z","avatar_url":"https://github.com/megahertz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](https://raw.githubusercontent.com/megahertz/electron-simple-updater/master/logo.png)\n# electron-simple-updater\n[![Build Status](https://travis-ci.org/megahertz/electron-simple-updater.svg?branch=master)](https://travis-ci.org/megahertz/electron-simple-updater)\n[![npm version](https://badge.fury.io/js/electron-simple-updater.svg)](https://badge.fury.io/js/electron-simple-updater)\n\n## Description\n\nThis module allows to automatically update your application. You only\nneed to install this module and write two lines of code! To publish\nyour updates you just need a simple file hosting, it does not require\na dedicated server.\n\nSupported OS: \n - Mac, ([Squirrel.Mac](https://github.com/Squirrel/Squirrel.Mac))\n - Windows ([Squirrel.Windows](https://github.com/Squirrel/Squirrel.Windows))\n - Linux (for [AppImage](http://appimage.org/) format)\n\n## Differences between electron-simple-updater and built-in autoUpdater\n\n* Actually, autoUpdater is used inside.\n* Linux support.\n* It handles Squirrel.Windows install/update command line arguments.\n* It doesn't require a dedicated release server.\n* You need only 2 lines of code to make it work.\n\n## Installation\n\nInstall with [npm](https://npmjs.org/package/electron-simple-updater):\n\n    npm install --save electron-simple-updater\n\n## Usage\n\n### Publish a new release\n1. Insert a link to a hosting where you will store updates.json to main.js. \nYou can find a sample of updates.json in [the example](example)\n\n    ```js\n    // Just place this code at the entry point of your application:\n    const updater = require('src/index');\n    updater.init('https://raw.githubusercontent.com/megahertz/electron-simple-updater/master/example/updates.json');\n    ```\n    You can set this link in package.json:updater.url instead of init() argument.\n\n2. Build your release using electron-builder or another tool.\nNote: Your application must be signed for automatic updates on macOS.\nThis is a requirement of Squirrel.Mac.\n\n3. Upload your release with update.json to a hosting. You can \ndo it [manually](example/updates.json) or use\n[electron-simple-publisher](https://github.com/megahertz/electron-simple-publisher)\nto simplify this process. Note: Squirrel.Mac requires a properly prepared\n`release.json` file. A release in the property `url` must be zipped .app file.\n\n4. That's it!\n\n    Now your application will check for updates on start and download it \n    automatically if an update is available. After app is restarted a new\n    version will be loaded. But you can customize it to ask a user if he\n    would like to install updates. See [the example](example) for details.\n    \n## API\n\n### Options\nYou can set options when calling init() method or in package.json:updater\nsection.\n\nName                | Default                 | Description\n--------------------|-------------------------|------------\nautoDownload        | true                    | Automatically download an update when it's found in updates.json\nchannel             | 'prod'                  | An application which is built for channel like 'beta' will receive updates only from this channel\ncheckUpdateOnStart  | true                    | Check for updates immediately when init() is called\ndisabled            | false                   | Disable update feature. This option is set to true automatically for applications built for Mac App Store or Windows Store\nlogger              | console                 | You can pass [electron-log](https://github.com/megahertz/electron-log), [winston](https://github.com/winstonjs/winston) or another logger with the following interface: { debug(), info(), warn() }. Set it to false if you would like to disable a logging feature \nversion             | app.getVersion()        | Current app version. In most cases, you should not pass this options manually, it is read by electron from version at package.json\nurl*                | undefined               | The only required parameter. This is a URL to [updates.json](https://github.com/megahertz/electron-simple-updater/blob/master/example/updates.json) file. You can use templates '{platform}', '{arch}' and '{channel}' in a file name.\n    \n### Method\n    \n#### init(options)\nInitialize a package. By default it finish the process if is run by\nSquirrel.Windows installer.\n\n#### setFeedURL(url) *deprecated*\nSets the url and initialize the electron-simple-updater. Instead of\nbuilt-in auto-updater init(), this method receives a URL to updates.json.   \n    \n#### getFeedURL() *deprecated*\nReturn the current updates.json URL.\n\n#### checkForUpdates() \nAsks the server whether there is an update. url must be set before this\ncall. Instead of built-in auto-updater, this method does not start\ndownloading if autoDownload options is set to false.\n    \n#### downloadUpdate()\nStart downloading update manually. You can use this method if\nautoDownload option is set to false\n    \n#### quitAndInstall()\nRestarts the app and installs the update after it has been downloaded.\nIt should only be called after update-downloaded has been emitted.\n\n#### setOptions(name, value)\nSet one or a few options. Pass an object as the name for multiple set.\n   \n### Properties (read only)\nThese properties are mapped to options \n\n * **build** \n * **channel**\n * **version**\n * **buildId** - this string contains a build, a channel and version\n    \n### Events\n**meta** object of some events is a data from updates.json\n   \n#### error(err)\nEmitted when there is an error while updating.\n\n#### checking-for-update \nEmitted when start downloading update.json file.\n\n#### update-available(meta)\nEmitted when there is an available update.\n\n#### update-not-available\nEmitted when there is no available update.\n\n#### update-downloading(meta)\nEmitted when star downloading an update.\n\n#### update-downloaded(meta)\nEmitted when an update has been downloaded.\n\n#### squirrel-win-installer(event)\nEmitted when the app is run by Squirrel.Windows when installing. The\nSimpleUpdater creates/removes shortcuts and finishes the process by\ndefault.\n\n * **event.preventDefault** - set to true if you would like to\n customize this action\n * **event.squirrelAction** - squirrel-install, squirrel-updated,\n squirrel-uninstall, squirrel-obsolete\n    \n## Related\n - [electron-builder](https://github.com/electron-userland/electron-builder) -\n A complete solution to package and build an Electron app. Also it contains\n alternative implementation of update package.\n - [electron-simple-publisher](https://github.com/megahertz/electron-simple-publisher) -\n Simple way to publish releases for electron-simple-updater\n    \n    \n## License\n\nLicensed under MIT.\n\nLogo was designed by [prolko](https://www.behance.net/prolko) base on the\noriginal [electron](https://github.com/electron/electron) logo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegahertz%2Felectron-simple-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegahertz%2Felectron-simple-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegahertz%2Felectron-simple-updater/lists"}