<commit_before># Snapcraft Guide (Ubuntu Software Center & More)

This guide provides information on how to package your Electron application
for any Snapcraft environment, including the Ubuntu Software Center.

## Background and Requirements

Together with the broader Linux community, Canonical aims to fix many of the
common software installation problems with the [`snapcraft`](snapcraft.io)
project. Snaps are containerized software packages that include required
dependencies, auto-update, and work on all major Linux distributions without
system modification.

There are three ways to create a `.snap` file:

1) Using `electron-installer-snap`, which takes `electron-packager's` output
2) Using an already created `.deb` package
3) Using [`electron-forge`](electron-forge) or
   [`electron-builder`](electron-builder), both tools that come with `snap`
   support out of the box. This is the easiest option.

In all cases, you will need to have the `snapcraft` tool installed. We
recommend building on Ubuntu 16.04 (or the current LTS).

```sh
snap install snapcraft --classic
```

While it _is possible_ to install `snapcraft` on macOS using Homebrew, you are
less likely to encounter issues when running `snapcraft` on an actual Linux
distribution. As of today, it is not able ot build `snap` packages, for instance.

# Using `electron-installer-snap`

The module works like `electron-winstaller` and similar modules in that its
scope is limited to building snap packages. You can install it with:

```sh
npm install --save-dev electron-installer-snap
```

## Step 1: Package Your Electron Application

Package the application using [electron-packager](electron-packager) (or a
similar tool). Make sure to remove `node_modules` that you don't need in your
final application, since any module you don't actually need will just increase
your application's size.

The output should look roughly like this:<commit_msg>:memo: Even more words<commit_after># Snapcraft Guide (Ubuntu Software Center & More)

This guide provides information on how to package your Electron application
for any Snapcraft environment, including the Ubuntu Software Center.

## Background and Requirements

Together with the broader Linux community, Canonical aims to fix many of the
common software installation problems with the [`snapcraft`](snapcraft.io)
project. Snaps are containerized software packages that include required
dependencies, auto-update, and work on all major Linux distributions without
system modification.

There are three ways to create a `.snap` file:

1) Using `electron-installer-snap`, which takes `electron-packager's` output
2) Using an already created `.deb` package
3) Using [`electron-forge`](electron-forge) or
   [`electron-builder`](electron-builder), both tools that come with `snap`
   support out of the box. This is the easiest option.

In all cases, you will need to have the `snapcraft` tool installed. We
recommend building on Ubuntu 16.04 (or the current LTS).

```sh
snap install snapcraft --classic
```

While it _is possible_ to install `snapcraft` on macOS using Homebrew, it
is not able to build `snap` packages and is focused on managed packages
in the store.

# Using `electron-installer-snap`

The module works like `electron-winstaller` and similar modules in that its
scope is limited to building snap packages. You can install it with:

```sh
npm install --save-dev electron-installer-snap
```

## Step 1: Package Your Electron Application

Package the application using [electron-packager](electron-packager) (or a
similar tool). Make sure to remove `node_modules` that you don't need in your
final application, since any module you don't actually need will just increase
your application's size.

The output should look roughly like this:
{'fraction_non_alphanumeric': 0.0691207627118644, 'fraction_numerical': 0.00423728813559322, 'mean_word_length': 4.97626582278481, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1985638', 'n_tokens_mistral': 1024, 'n_tokens_neox': 940, 'n_words': 509}