asar-trim

1.1.0 • Public • Published

asar-trim

An experimental CLI tool that trims unnecessary files from asar archives for Electron applications.

Buy Me a Coffee at ko-fi.com

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

Readme

Keywords

none

Package Sidebar

Install

npm i asar-trim

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

13.9 kB

Total Files

7

Last publish

Collaborators

  • depthbomb