npm install --save-dev gulp-atom-electron
You can use this module in two distinct ways: to package your application and/or to download a version of Electron to disk.
How to Package Your Application
You should source your app's files using
gulp.src and pipe them through
gulp-atom-electron. The following task will create your application in
app folder, ready for launch.
var gulp = ;var symdest = ;var electron = ;gulp;
Note: It is important to use
gulp-symdest only because of the OS X
platform. An application bundle has symlinks within and if you use
to pipe the built app to disk, those will be missing.
symdest will make
sure symlinks are taken into account.
Finally, you can always pipe it to a zip archive for easy distribution. joaomoreno/gulp-vinyl-zip is recommended:
var gulp = ;var zip = ;var electron = ;gulp;
How to Download Electron
There's also a very handy export
electron.dest() function that
makes sure you always have the exact version of Electron in a directory:
var gulp = ;var electron = ;gulp;
This will place a vanilla Electron build into the
If you run it consecutively and it detects that the version in the destination directory
is the intended one, it will end up in a no-op. Else it will download the provided version
and replace it.
You must provide the following options:
version- the Electron version to use
platform- kind of OS (
The following options are optional:
quiet- suppress a progress bar when downloading
token- GitHub access token(to avoid request limit. You can grab it here)
arch- the processor architecture (
winIcon- path to an
companyName- company name
copyright- copyright statement
darwinIcon- path to an
darwinBundleDocumentTypes- (reference) array of dictionaries, each containing the following structure:
stringarray of file extensions
linuxExecutableName- overwrite the name of the executable in Linux