asar | Package asar reads and writes ASAR | Continuous Backup library

 by   layeh Go Version: Current License: MPL-2.0

kandi X-RAY | asar Summary

kandi X-RAY | asar Summary

asar is a Go library typically used in Backup Recovery, Continuous Backup applications. asar has no bugs, it has no vulnerabilities, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

Package asar reads and writes ASAR (Atom-Shell Archive) archives.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              asar has a low active ecosystem.
              It has 15 star(s) with 8 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 4 open issues and 1 have been closed. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of asar is current.

            kandi-Quality Quality

              asar has no bugs reported.

            kandi-Security Security

              asar has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              asar is licensed under the MPL-2.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              asar releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed asar and discovered the below as its top functions. This is intended to give you an instant insight into asar implemented functionality, and help decide if they suit your requirements.
            • Main entry point
            • Decode reads an Entry from a ReaderAt .
            • parseEntry parses an entry into parent .
            • decodeHeader decodes an entry in the ASAR section
            • walk walks the Entry tree rooted at parentPath .
            • parseRoot parses a json file
            • Find returns the entry with the given name .
            • New returns a new Entry .
            • parseFiles scans a json file
            • validFilename returns true if filename is valid .
            Get all kandi verified functions for this library.

            asar Key Features

            No Key Features are available at this moment for asar.

            asar Examples and Code Snippets

            No Code Snippets are available at this moment for asar.

            Community Discussions

            QUESTION

            Error when trying to create a PDF with Electron and node-html-pdf
            Asked 2021-May-23 at 21:19

            I have this little aplication that creates a PDF from a simple form in electron with html-pdf, it works fine when I run npm start(electron .), but after build when I try to generate the PDF I get this error:

            A JavaScript error occurred in the mais process
            Error: write EPIPE
            at afterWriteDispatched(internal/stream_base_commons.js:156:25)
            at writeGeneric (internal/stream_base_commons.js:147:3)

            This is my main file "index.js"

            ...

            ANSWER

            Answered 2021-May-23 at 21:19

            So I found a similar error in this post with the electron-pdf, that was solved changing the "electron-pdf" to a parent folder outer of node_module, something related with the "asar" that wasn't allowing any write operation. In my case what I needed to do was change my compiler method, so I first created a new project using the boilerplate,

            "npm create-electron-app"

            Which already have a method to build application that is "npm run make", it apparently solved the problem of permission issue to write with the html-pdf from the node_modules, working just fine after build.

            Source https://stackoverflow.com/questions/67626910

            QUESTION

            SpawnSync doesn't work when using electron-builder
            Asked 2021-May-17 at 09:56

            I am writing an react-electron application and I noticed that when I used electron-builder to build it the binary was stuck when calling "spawn".

            With "yarn start" the application can be executed without problems. Only with electron-builder it gets stuck.

            Can you help ?

            Thanks,

            Update

            It seems that the C++ binary included as part of the program can't be executed within electron. If I give the hardcoded full path to the binary it works but if I give the path from __dirname I get an error

            ...

            ANSWER

            Answered 2021-May-17 at 09:56

            By default, Electron Builder compiles your application and packs all resources into one large archive file (think of it as a ZIP file) which can be read just fine because Electron brings support for this format known as "ASAR".

            When running the built program, the code will be read from the archive. This means that __dirname will point to a directory inside the archive. The operating system, however, cannot read from the archive. Since you did not actually include the piece of code calling child_process.spawn (), I can only speculate on why you get ENOTDIR, which hints that a given path is not a directory when it was expected to be one, but I assume this is because you point to a path inside the ASAR file.

            When relying on external binaries, it is a good idea to keep them outside the ASAR archive and programmatically find the path to them (which is quite complex) or by preventing Electron Builder from compiling your app into an ASAR file. However, you would also have to ask Electron Builder to include the executable in the built version of your app. This can be done by modifying your package.json:

            Source https://stackoverflow.com/questions/67558468

            QUESTION

            ReferenceError: BigInt is not defined Asar Electron Nodejs
            Asked 2021-May-11 at 04:31

            Hello have been trying to extract and repack an app.asar to update files inside the package :

            await asar.extractAll(path.join(__dirname, './app.asar'),path.join(__dirname, './destfolder'));

            Then changing some files in destfolder then

            await asar.createPackage(path.join(__dirname, './destfolder'),path.join(__dirname, './app.asar'));

            But i have been getting this error :

            ...

            ANSWER

            Answered 2021-May-11 at 02:58

            That error is apparently coming from this line of code in the asar package's lib/filesystem.js:

            Source https://stackoverflow.com/questions/67479352

            QUESTION

            node-canvas in electron -- "mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed."
            Asked 2021-May-09 at 17:31

            I'm cresting electron app using node-canvas.
            I generated an app-installer by the following command:

            $ electron-builder --mac --x64 --config ./build_mac.js

            build_mac.js

            ...

            ANSWER

            Answered 2021-May-09 at 17:31

            The solution to fix this is put all dylibs (except under "/usr/lib" or "/System/Library/Frameworks") under the folder which is in under control of electron.

            Something like this in my project: https://github.com/code4history/MaplatEditor/tree/master/assets/mac/canvas/build/Release

            But just putting dylib is not working, because each dylib has information about link to other libraries.

            You can check which libraries are linked from each dylib by using "otool" command, and youcan overwrite it by using "install_name_tool" command.

            https://github.com/code4history/MaplatEditor/blob/master/mac_canvas_dylib

            In this URL, you can find what I did for my project.

            Source https://stackoverflow.com/questions/66733391

            QUESTION

            Electron: Crash after build exe
            Asked 2021-Apr-01 at 07:42

            I am tring merge wiki.js with electron
            and, I can make simple electron application as below code

            main.js

            ...

            ANSWER

            Answered 2021-Apr-01 at 07:42

            I Found Solution Instead of running with a mouse double click at File Explorer, I used windows command prompt to run exe, and, from there, I can find error logs.

            So, I found: the some relative path is not working, because, the electron pack source code with asar.

            and, some file operate is not working, etc fs.read, fs.readDir.

            Cannot access files inside asar archive in electron app ,

            So, I removed this problem.

            Source https://stackoverflow.com/questions/66873027

            QUESTION

            VSCode crashes when starting up in Ubuntu
            Asked 2021-Mar-24 at 09:18

            I changed my workspace to Ubuntu recently, and I encountered the crashing problem.

            The vscode was installed by apt. And it could be open for a few seconds, then it crashes automatically.

            I tried to figure it out with the code --verbose command. It shows

            ...

            ANSWER

            Answered 2021-Mar-19 at 02:52

            I was experiencing the same issue. I'm using Pop OS 20.04 LTS and Visual Studio Code would crash after startup. It seems the problem might be related to mixing the .snap package installation with the .deb package. This github comment has a solution that worked for me: (https://github.com/microsoft/vscode/issues/118727#issuecomment-801847011)

            I had to remove the vscodevscode.github-authentication/github.auth entry from the Passwords and Keys app.

            Source https://stackoverflow.com/questions/66583287

            QUESTION

            electron ffmpeg mas build "Illegal instruction: 4"
            Asked 2021-Mar-08 at 21:46

            I am trying to release an electron app on the Mac Apple Store (mas), my electron app uses ffmpeg to render videos. In order to release my app on the mac apple store, It needs to be sandboxed, and by default ffmpeg makes calls to external libraries so I need to statically build ffmpeg and package it with my app. My code is on the 'mas-ffmpeg-fix' branch: https://github.com/MartinBarker/digify/tree/mas-ffmpeg-fix

            My static ffmpeg build works before I build my app, but after running electron-builder build --mac, the ffmpeg executable now fails with Illegal instruction: 4

            This is the full timeline of building/packaging/submitting my app to the mac apple store and where the error first appears:

            • In Digify repo:

            • clone, configure, and build static ffpmeg: “sudo rm -rf ffmpeg-mac/ && npm run download-ffmpeg”

            • download-ffmpeg command is inside package.json and runs this: git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg-mac && cd ffmpeg-mac && ./configure pkg_config='pkg-config --static' --pkg-config-flags='--static' --libdir=/usr/local/lib --extra-version=ntd_20150128 --disable-shared --disable-lzma --enable-gpl --enable-pthreads --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libx264 --enable-static --enable-filters --enable-runtime-cpudetect && make && cd ..

            • Check if any dylibb files in the static ffmpeg build with command: “otool -L ffmpeg-mac/ffmpeg | grep /usr/local”

            • If there are any, move them to folder in desktop, run ‘otool’ again to ensure there are no dynamic libraries, rebuild static ffmpeg.

            • there will now be a folder 'ffmpeg-mac' which contains static versions of ffmpeg and ffprobe

            Using ffmpeg with electron UI: works Using Ffmpeg with command-line command: /Users/martinbarker/Documents/projects/digify-new/ffmpeg-mac/ffmpeg -h Works

            • Build mac mass app with “npm run build-mas“
            • When this command finishes it will output two files inside the /dist/mas/ folder: Digify.app and Digify-01.20.pkg (or whatever version number it is) Ffmpeg command-line check: /Users/martinbarker/Documents/projects/digify-new/dist/mas/Digify.app/Contents/Resources/ffmpeg -h Illegal instruction: 4

            This is the first place the error appears, after building my mac mac-apple-store app, ffmpeg fails with this err.

            • Sign built app with .sh file: “sh mas-sign-script.sh” view .sh file here
              • the .sh file will output Digify-mac.pkg
            • Easier command to both build & sign: “sudo rm -rf dist/mas/ && npm run build-mas && sh mas-sign-script.sh”
            • Upload the outputted “Digify-mac.pkg” file & submit to apple for review

            Once this app gets published in the store, if you download it and try to run an ffmpeg command with the electron UI, it fails with this error:

            ...

            ANSWER

            Answered 2021-Mar-08 at 21:46

            Turns out in electron you need to pick the output folder directory first with a file browser window before ffmpeg can write any files

            Source https://stackoverflow.com/questions/66286440

            QUESTION

            access to extraFiles electron-builder from packaged asar app electron
            Asked 2021-Mar-07 at 12:44

            I have an electron app that run perfectly into a dev environment with logs engine that write into file (with winston.js).

            The structure of the project is this :

            When I run electron-builder for packaging my app I have this struture :

            • my app.asar file is into Resources directory
            • my logs files are into data/logs

            In dev environment I access to logs file with this winston config :

            ...

            ANSWER

            Answered 2021-Mar-07 at 12:44

            For getting the resources and extraFiles paths in a packaged app as described in the electron-builder docs you can use process.resourcesPath

            Source https://stackoverflow.com/questions/66444014

            QUESTION

            How to reduce electron apps size
            Asked 2021-Jan-26 at 16:25

            My electron application is insanely big on Mac after installation. It's around 1.39GB for no apparent reason, even though it's around 70MB on Windows. I tried to unpack the dmg file to see what makes it so big then found a file called app.asar that takes a large size of the app (1.22GB) and I don't know how to unpack this file. So my question is, How to make the application's size much smaller like on windows? and what does app.asar file contain?

            I'm using electron-builder to build the app by the way

            ...

            ANSWER

            Answered 2021-Jan-26 at 16:25

            It depends on your app. If your app is too heavy, then it might be natural. If not; try removing unwanted packages in the node_modules directory using npm. Try instructions here :

            https://www.electronjs.org/docs/tutorial/application-distribution

            Make electron app smaller?

            https://github.com/electron/electron/issues/2003

            You can also unpack the asar file using:

            Source https://stackoverflow.com/questions/65903699

            QUESTION

            Using Chocolatey VS Code from within WSL Ubuntu
            Asked 2021-Jan-25 at 17:22

            I cannot get VS Code code.exe to run properly within WSL. (I found a connected question here, but it does not solve this issue - Launch VS Code from WSL Bash).

            Within WSL (any distro) we can access any executables on Windows. e.g.

            ...

            ANSWER

            Answered 2021-Jan-25 at 17:22

            My installation has a shell script for launching VSCode in ../Microsoft VS Code/bin/code. I'm fairly certain that it is installed with VSCode, but there's a chance it comes from the "Remote - WSL" extension.

            Is that present in your installation? If so, add that bin directory to your path (the full installer does this automatically). Then just use code rather than code.exe to launch from within WSL.

            If not, first make sure the "Remote - WSL" extension is installed in VSCode (or better yet, the "Remote Development" extension pack, which includes the WSL support). If it's still not there after that, here are the contents of the script that should live in VSCode/bin/code:

            Source https://stackoverflow.com/questions/65874775

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install asar

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/layeh/asar.git

          • CLI

            gh repo clone layeh/asar

          • sshUrl

            git@github.com:layeh/asar.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Continuous Backup Libraries

            restic

            by restic

            borg

            by borgbackup

            duplicati

            by duplicati

            manifest

            by phar-io

            velero

            by vmware-tanzu

            Try Top Libraries by layeh

            radius

            by layehGo

            gopher-luar

            by layehGo

            kjv

            by layehC

            gumble

            by layehGo

            barnard

            by layehGo