asar-trim
v1.1.0
Published
An experimental CLI tool that trims unnecessary files from asar archives for Electron applications.
Downloads
14
Readme
Installation
npm i asar-trim -g
Usage
$ asar-trim <path to resources containing app.asar>
What is it?
Many popular Electron applications today sure like to include their dev dependencies, raw frontend assets, and even source files in their final package which inflates the already-large size to greater lengths.
This tool attempts to delete these files and repack the asar file to produce a much slimmer archive.
What does it do?
There are a few things asar-trim
will do when it does its optimization:
- Deletes various files that have no use in the application
- You can see what is deleted here
- Minifies .json files
- Minifies and removes unneeded properties from package.json files
Commands
<default>
Trims the app.asar file at the location denoted by the path provided.
Usage
$ asar-trim .
Options
| Option | Default Value | Description |
| ------------------------- | --------------- | ------------------------------------------------------------------------------------------------ |
| -b
, --backup
| false | Create a backup of the original app.asar file |
| -k
, --keep-extracted
| false | Whether to keep the extracted app.asar contents after optimizing instead of deleting them |
| -h
, --hint-file
| | Path to your app's generated load order hint file, see https://github.com/atom/atom/issues/10163 |
Planned Features
- Trimming app.asar.unpacked directory
- Improved backing up
- Additional options to customize what files will be deleted