3.1.0 • Published 25 days ago

pear-updater v3.1.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
25 days ago

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

3.1.0

25 days ago

3.0.4

3 months ago

3.0.3

3 months ago

3.0.2

3 months ago

3.0.1

3 months ago

3.0.0

3 months ago

2.0.0

3 months ago

0.0.0

4 months ago