From f5dc8fc80d529110b8faf7f1ecf01450a3a5cbed Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 21 Mar 2015 19:11:15 +0800 Subject: [PATCH] docs: How to use asar archive with unpacked files --- docs/tutorial/application-packaging.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/tutorial/application-packaging.md b/docs/tutorial/application-packaging.md index cb95fd48..f7c18b9c 100644 --- a/docs/tutorial/application-packaging.md +++ b/docs/tutorial/application-packaging.md @@ -142,6 +142,22 @@ archives is generated by guessing, because those files do not exist on the filesystem. So you should not trust the `Stats` object except for getting file size and checking file type. -## Unpacking files in `asar` archive +## Adding unpacked files in `asar` archive + +As stated above, some Node APIs will unpack the file to filesystem when +calling, apart from the performance issues, it could also lead to false alerts +of virus scanners. + +To work around this, you can unpack some files creating archives by using the +`--unpack` option, an example of excluding shared libraries of native modules +is: + +```bash +$ asar pack app app.asar --unpack *.node +``` + +After running the command, apart from the `app.asar`, there is also an +`app.asar.unpacked` folder generated which contains the unpacked files, you +should copy it together with `app.asar` when shipping it to users. [asar]: https://github.com/atom/asar -- 2.43.0