Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is .asar file and why it's used in electron applications

Tags:

electron

asar

So the question is in the title. As far as I understand, .asar is kind of archived file using in electron app. But what is the goal for it?

like image 344
Vladimir Melekh Avatar asked Sep 13 '16 20:09

Vladimir Melekh


People also ask

What is an .asar file?

Asar is a simple extensive archive format, it works like tar that concatenates all files together without compression, while having random access support.

How do you use Asar in electrons?

To use an asar archive to replace the app folder, you need to rename the archive to app. asar , and put it under Electron's resources directory like below, and Electron will then try to read the archive and start from it. You can find more details on how to use asar in the electron/asar repository.


1 Answers

Asar is used to concatenate your application files to one big file, it mitigates issues and it slightly speeds up require.

To mitigate issues around long path names on Windows, slightly speed up require and conceal your source code from cursory inspection, you can choose to package your app into an asar archive with little changes to your source code.

web archive of original URL Electron en ebook

like image 92
Lukas Rotermund Avatar answered Oct 12 '22 21:10

Lukas Rotermund