nw-nsis-compat-updater

1.0.1 • Public • Published

nw-nsis-compat-updater

nw-nsis-compat-updater is an auto updater implementation for NW.js.

API

Imports

const { NsisCompatUpdater } = require('nw-nsis-compat-updater');

Types

interface IInstaller {
  arch: string
  path: string
  hash: string
  created: number
}

interface IUpdater {
  arch: string
  fromVersion: string
  path: string
  hash: string
  created: number
}

interface IVersion {
  version: string
  changelog: string
  source: string
  installers: IInstaller[]
  updaters: IUpdater[]
}

interface IStreamProgress {
  percentage: number
  transferred: number
  length: number
  remaining: number
  eta: number
  runtime: number
  delta: number
  speed: number
}

Other

new NsisCompatUpdater(feed: string, version: string, arch: 'x86' | 'x64')

const updater = new NsisCompatUpdater(feed, version, arch);

updater.onDownloadProgress.subscribe((state: IStreamProgress) => void)

updater.onDownloadProgress.unsubscribe((state: IStreamProgress) => void)

updater.checkForUpdates(): Promise<IVersion | null>

Returns an instance of IVersion if new version is available, otherwise null.

updater.downloadUpdate(version: string): Promise<string>

Returns the temporary path of the downloaded update.

updater.quitAndInstall(path: string)

Readme

Keywords

none

Package Sidebar

Install

npm i nw-nsis-compat-updater

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

251 kB

Total Files

6

Last publish

Collaborators

  • heora