Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

asar-updater

0.3.2 • Public • Published

asar-updater

Build Status Dependency Status devDependency Status js-standard-style

An auto updater for electron asar

NPM js-standard-style

Usage

const path = require('path')
const { app } = require('electron')
const updater = require('../')
 
app.on('ready', () => {
  updater.init()
  updater.on('available', (task) => {
    console.log('available', task)
  })
  updater.on('not-available', (task) => {
    console.log('not-available', task)
  })
  updater.on('progress', (task, p) => {
    console.log(task.name, p)
  })
  updater.on('downloaded', (task) => {
    console.log('downloaded', task)
  })
  updater.on('completed', (manifest, tasks) => {
    console.log('completed', manifest, tasks)
    app.quit()
  })
  updater.on('error', (err) => {
    console.error(err)
    app.quit()
  })
  updater.setFeedURL(path.join(__dirname, 'core.asar'), 'http://git.oschina.net/wedn/ebp/raw/vue/latest/core.json')
  updater.setFeedURL(path.join(__dirname, 'data.asar'), 'http://git.oschina.net/wedn/ebp/raw/vue/latest/data.json')
  updater.checkForUpdates()
})
 

Example

Install

npm i asar-updater

DownloadsWeekly Downloads

1

Version

0.3.2

License

MIT

Last publish

Collaborators

  • avatar
  • avatar