asar

Pack and extract Electron application archives.

TLDR

Create asar archive
$ asar pack [dir/] [output.asar]
Extract asar archive
$ asar extract [archive.asar] [output_dir/]
List contents
$ asar list [archive.asar]
Extract single file
$ asar extract-file [archive.asar] [path/in/archive] [output_file]
Pack while keeping files unpacked
$ asar pack [dir/] [output.asar] --unpack [*.node]

SYNOPSIS

asar pack|extract|list|extract-file [options] arguments

DESCRIPTION

asar creates and extracts Electron archive files. ASAR (Atom Shell Archive) is a tar-like format used by Electron applications to package source files into a single file while maintaining random access capability.The format allows Electron to read files directly from the archive without extraction, improving load times. The tool is distributed on npm as @electron/asar (formerly the standalone asar package).

PARAMETERS

pack dir output (alias p)

Create archive from directory
extract archive dest (alias e)
Extract archive to directory
list archive (alias l)
List archive contents
extract-file archive file dest (alias ef)
Extract single file
--unpack glob
Keep files matching the glob unpacked (stored in a sibling app.asar.unpacked directory)
--unpack-dir glob
Keep directories matching the glob unpacked
--exclude-hidden
Exclude hidden (dotfile) files from the archive
--ordering file
Pack files in the order listed in the given file

INSTALL

sudo pacman -S asar
sudo zypper install asar
nix profile install nixpkgs#asar

CAVEATS

ASAR archives are not encrypted; contents can be easily extracted. Some Electron apps may integrity-check their archives. Not suitable for sensitive data.

HISTORY

ASAR was developed for the Atom text editor (later Electron framework) as a way to package Node.js applications efficiently.

SEE ALSO

tar(1), npm(1), electron(1)

RESOURCES

Source code · Homepage