How to unpack an .asar file?

I have packed my Electron application using the following command:

asar pack app app.asar

Now, I need to unpack it and get the whole code back. Is there any way to do so?

2 Answers

From the asar documentation

(the use of npx here is to avoid to install the asar tool globally with npm install -g asar)

Extract the whole archive:

npx asar extract app.asar destfolder 

Extract a particular file:

npx asar extract-file app.asar main.js
13

It is possible to upack without node installed using the following 7-Zip plugin:

Thanks @MayaPosch for mentioning that in this comment.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like