Gathering detailed insights and metrics for electron-installer-debian
Gathering detailed insights and metrics for electron-installer-debian
Gathering detailed insights and metrics for electron-installer-debian
Gathering detailed insights and metrics for electron-installer-debian
npm install electron-installer-debian
81.4
Supply Chain
97.6
Quality
80.1
Maintenance
100
Vulnerability
98.2
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
377 Stars
304 Commits
70 Forks
12 Watching
12 Branches
20 Contributors
Updated on 25 Nov 2024
JavaScript (92.79%)
EJS (5.59%)
HTML (0.69%)
Shell (0.56%)
CSS (0.37%)
Cumulative downloads
Total Downloads
Last day
-13.1%
7,857
Compared to previous day
Last week
-8.6%
53,946
Compared to previous week
Last month
18.5%
253,457
Compared to previous month
Last year
41%
2,124,288
Compared to previous year
Create a Debian package for your Electron app.
Usage | Options | Release Notes | License | Code of Conduct | Support
This tool requires Node 10 or greater, fakeroot
, and dpkg
to build the .deb
package.
I'd recommend building your packages on your target platform, but if you insist on using Mac OS X, you can install these tools through Homebrew:
$ brew install fakeroot dpkg
For use from command-line:
$ npm install -g electron-installer-debian
For use in npm scripts or programmatically:
$ npm install --save-dev electron-installer-debian
Say your Electron app lives in path/to/app
, and has a structure like this:
.
├── LICENSE
├── README.md
├── node_modules
│  ├── electron-packager
│  └── electron
├── package.json
├── resources
│  ├── Icon.png
│  ├── IconTemplate.png
│  └── IconTemplate@2x.png
└── src
├── index.js
├── main
│  └── index.js
└── renderer
├── index.html
└── index.js
You now run electron-packager
to build the app for Debian:
$ electron-packager . app --platform linux --arch x64 --out dist/
And you end up with something like this in your dist
folder:
.
└── dist
  └── app-linux-x64
  ├── LICENSE
  ├── LICENSES.chromium.html
  ├── content_shell.pak
  ├── app
  ├── icudtl.dat
  ├── libgcrypt.so.11
  ├── libnode.so
  ├── locales
  ├── natives_blob.bin
  ├── resources
  ├── snapshot_blob.bin
  └── version
How do you turn that into a Debian package that your users can install?
If you want to run electron-installer-debian
straight from the command-line, install the package globally:
$ npm install -g electron-installer-debian
And point it to your built app:
$ electron-installer-debian --src dist/app-linux-x64/ --dest dist/installers/ --arch amd64
You'll end up with the package at dist/installers/app_0.0.1_amd64.deb
.
If you want to run electron-installer-debian
through npm, install the package locally:
$ npm install --save-dev electron-installer-debian
Edit the scripts
section of your package.json
:
1{ 2 "name": "app", 3 "description": "An awesome app!", 4 "version": "0.0.1", 5 "scripts": { 6 "start": "electron .", 7 "build": "electron-packager . app --platform linux --arch x64 --out dist/", 8 "deb64": "electron-installer-debian --src dist/app-linux-x64/ --dest dist/installers/ --arch amd64" 9 }, 10 "devDependencies": { 11 "electron-installer-debian": "^0.6.0", 12 "electron-packager": "^9.0.0", 13 "electron": "~1.7.0" 14 } 15}
Note: The versions in devDependencies
are examples only, please use the latest package versions
when possible.
And run the script:
$ npm run deb64
You'll end up with the package at dist/installers/app_0.0.1_amd64.deb
.
Install the package locally:
$ npm install --save-dev electron-installer-debian
And write something like this:
1const installer = require('electron-installer-debian') 2 3const options = { 4 src: 'dist/app-linux-x64/', 5 dest: 'dist/installers/', 6 arch: 'amd64' 7} 8 9async function main (options) { 10 console.log('Creating package (this may take a while)') 11 try { 12 await installer(options) 13 console.log(`Successfully created package at ${options.dest}`) 14 } catch (err) { 15 console.error(err, err.stack) 16 process.exit(1) 17 } 18} 19main(options)
You'll end up with the package at dist/installers/app_0.0.1_amd64.deb
.
Note: As of 1.0.0, the Node-style callback pattern is no longer available. You can use
util.callbackify
if this is
required for your use case.
Even though you can pass most of these options through the command-line interface, it may be easier to create a configuration file:
1{ 2 "dest": "dist/installers/", 3 "icon": "resources/Icon.png", 4 "compression": "gzip", 5 "categories": [ 6 "Utility" 7 ], 8 "lintianOverrides": [ 9 "changelog-file-missing-in-native-package" 10 ] 11}
And pass that instead with the config
option:
$ electron-installer-debian --src dist/app-linux-x64/ --arch amd64 --config config.json
Anyways, here's the full list of options:
Type: String
Default: undefined
Path to the folder that contains your built Electron application.
Type: String
Default: undefined
Path to the folder that will contain your Debian installer.
Type: Function
Default: function (dest, src) { return path.join(dest, src); }
Function that renames all files generated by the task just before putting them in your dest
folder.
Type: String
Default: package.name || "electron"
Name of the package (e.g. atom
), used in the Package
field of the control
specification.
According to the Debian Policy Manual:
Package names [...] must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.). They must be at least two characters long and must start with an alphanumeric character.
electron-installer-debian
will try to help conform to these requirements by lowercasing the name
provided and replacing any invalid characters with -
s.
Type: String
Default: package.productName || package.name
Name of the application (e.g. Atom
), used in the Name
field of the desktop
specification.
Type: String
Default: package.genericName || package.productName || package.name
Generic name of the application (e.g. Text Editor
), used in the GenericName
field of the desktop
specification.
Type: String
Default: package.description
Short description of the application, used in the Description
field of the control
specification.
Type: String
Default: package.productDescription || package.description
Long description of the application, used in the Description
field of the control
specification.
Type: String
Default: package.version || "0.0.0"
Version number of the package, used in the Version
field of the control
specification.
Type: String
Default: undefined
Revision number of the package, used in the Version
field of the control
specification and, by default, the filename of the generated .deb
file.
Type: String
Default: "utils"
Application area into which the package has been classified, used in the Section
field of the control
specification.
You can read more about sections, and also check out the list of existing sections in Debian unstable.
Type: String
Default: "optional"
How important it is that the user have the package installed., used in the Priority
field of the control
specification.
You can read more about priorities.
Type: String
Default: undefined
Machine architecture the package is targeted to, used in the Architecture
field of the control
specification.
For possible values see the output of dpkg-architecture -L
.
Type: Integer
Default: size of the folder
Estimate of the total amount of disk space required to install the named package, used in the Installed-Size
field of the control
specification.
Type: Array[String]
Default: For depends
, the minimum set of packages necessary for Electron to run; See source code for recommends
, suggests
, enhances
, and preDepends
default values
Relationships to other packages, used in the Depends
, Recommends
, Suggests
, Enhances
and Pre-Depends
fields of the control
specification.
All user dependencies will be appended to the Default
array of dependencies and any duplicates will be removed.
Type: String
Default: package.author.name <package.author.email>
Maintainer of the package, used in the Maintainer
field of the control
specification.
Type: String
Default: package.homepage || package.author.url
URL of the homepage for the package, used in the Homepage
field of the control
specification.
Type: String
Default: package.name || "electron"
Relative path to the executable that will act as binary for the application, used in the Exec
field of the desktop
specification.
The generated package will contain a symlink /usr/bin/<%= options.name %>
pointing to the path provided here.
For example, providing this configuration:
1{ 2 src: '...', 3 dest: '...', 4 name: 'foo', 5 bin: 'resources/cli/launcher.sh' 6}
Will create a package with the following symlink:
usr/bin/foo@ -> ../lib/foo/resources/cli/launcher.sh
And a desktop specification with the following Exec
key:
Exec=foo %U
Type: String
or Object[String:String]
Default: resources/icon.png
Path to a single image that will act as icon for the application:
1{ 2 icon: 'resources/Icon.png' 3}
Or multiple images with their corresponding resolutions:
1{ 2 icon: { 3 '48x48': 'resources/Icon48.png', 4 '64x64': 'resources/Icon64.png', 5 '128x128': 'resources/Icon128.png', 6 '256x256': 'resources/Icon256.png', 7 'scalable': 'resources/Icon.svg' 8 } 9}
Note that the image files must be one of the types: PNG or SVG. The support for SVG works only on scalable
resolution.
Type: Array[String]
Default: ['GNOME', 'GTK', 'Utility']
Categories in which the application should be shown in a menu, used in the Categories
field of the desktop
specification.
For possible values check out the Desktop Menu Specification.
Type: Array[String]
Default: []
MIME types the application is able to open, used in the MimeType
field of the desktop
specification.
Type: Array[String]
Default: []
You can use these to quieten lintian
.
Type: Object[String:String]
Default: undefined
Path to package maintainer scripts with their corresponding name, used in the installation procedure:
1{ 2 scripts: { 3 'preinst': 'resources/preinst_script', 4 'postinst': 'resources/postinst_script', 5 'prerm': 'resources/prerm_script', 6 'postrm': 'resources/postrm_script' 7 } 8}
You can read more about package maintainer scripts and general scripts
Type: String
Default: resources/desktop.ejs
The absolute path to a custom template for the generated FreeDesktop.org desktop entry file.
Type: String
Default: xz
Set the compression type used by dpkg-deb when building .deb package
Allowed values: 'xz', 'gzip', 'bzip2', 'lzma', 'zstd', 'none'
Used by dpkg-deb
to set the compression type. You can read more about it on the manual page of dpkg-deb
The package installs the Electron application into /usr/lib
, since there are
architecture-specific files in the package. There was a discussion in the issue
tracker about the
installation directory.
In versions of electron-installer-debian
prior to 0.5.0, the app was (incorrectly) installed in
/usr/share
.
git clone git://github.com/electron-userland/electron-installer-debian.git
Copyright (c) 2016 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 8/14 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More