The electron-installer-snap API uses the Promise pattern to perform asynchronous operations.
electron-installer-snap
Minimal example:
const snap = require('electron-installer-snap') const snapPath = await snap(options) console.log(`Created snap at ${snapPath}!`)
Full example with Electron Packager:
const packager = require('electron-packager') const snap = require('electron-installer-snap') const arch = 'x64' const paths = await packager({dir: '/path/to/app', platform: 'linux', arch: arch}) const snapPath = await snap({src: paths[0], arch: arch}) console.log(`Created snap at ${snapPath}!`)
If you need to use the callback pattern instead of the async/await pattern, look into the util.callbackify function.
async
await
util.callbackify
Additional Snapcraft configuration that is merged directly into snapcraft.yaml. In general, this does not override any configuration that is set via [[Options]].
snapcraft.yaml
Generated using TypeDoc
The
electron-installer-snapAPI uses the Promise pattern to perform asynchronous operations.Minimal example:
const snap = require('electron-installer-snap') const snapPath = await snap(options) console.log(`Created snap at ${snapPath}!`)Full example with Electron Packager:
const packager = require('electron-packager') const snap = require('electron-installer-snap') const arch = 'x64' const paths = await packager({dir: '/path/to/app', platform: 'linux', arch: arch}) const snapPath = await snap({src: paths[0], arch: arch}) console.log(`Created snap at ${snapPath}!`)If you need to use the callback pattern instead of the
async/awaitpattern, look into theutil.callbackifyfunction.