pear-updater

3.1.0 • Public • Published

Pear Updater

The updater the pear-runtime runs on.

npm install pear-updater

Usage

const PearUpdater = require('pear-updater')

const u = new PearUpdater(drive, {
  directory: '/where/is/platform/dir',
  swap: '/current/swap/to/use/0',
  checkout: { key: 'z32-key-in-use', length: 42, fork: 0 }, // current checkout in swap
  async onupdating (newCheckout) {
    // fired before updates with an async ctx
  },
  async onupdate (newCheckout) {
    // fired on updates with an async ctx
  }
})

u.on('updating', function (checkout) {
  // emitted when a new update is being downloaded
})

u.on('update', function (checkout) {
  // emitted when a new update has been downloaded
})

for await (const checkout of u.watch(opts)) {
  // watch all updates as they come in, opts forwarded to streamx readable
}

// wait for a min version, opts forwarded to streamx readable
await u.wait(minimumCheckout, opts)

License

Apache-2.0

Readme

Keywords

none

Package Sidebar

Install

npm i pear-updater

Weekly Downloads

213

Version

3.1.0

License

Apache-2.0

Unpacked Size

26.4 kB

Total Files

4

Last publish

Collaborators

  • mafintosh
  • davidmarkclements