Protected ReadonlyenvProtected ReadonlyextractionThe folder within the configuration directory into which resources are extracted.
Protected ReadonlyfileProtected ReadonlyloggerProtected ReadonlyresolvedProtected ReadonlystaleResources extracted for another application version are removed when they are older than this.
ProtectedtemporaryProtectedcollectCollect the files of the given resource as paths relative to it. The relative path of a resource that is a plain file is the empty string.
ProtectedcopyProtecteddoProtectedexistsProtectedextractProtectedfindFind the archive that the given resource is packaged into, if any.
the path of the archive, i.e. the shortest prefix of the given path ending in an .asar segment,
which is also how Electron itself determines the archive that a path refers to.
ProtectedgetIdentify the content of the given archive. process.noAsar is toggled around the synchronous stat call
to get the stats of the archive file itself rather than of the directory that it appears as.
ProtectedgetThe directory into which resources of the given archive are extracted. It is specific to the content of the archive, so that updating the application invalidates previously extracted copies.
ProtectedgetFallback for applications whose configuration directory cannot be written to. The directory is unique to this run of the application, so that resources are extracted again whenever the application is started.
ProtectedisWhether every file of the given resource is already available at the given target path. Packaging tools only unpack the files that the application configured them to unpack, so a partial copy must be ignored.
ProtectedisProtectedremoveRemove resources that were extracted from an earlier version of the archive, unless they were used recently, because another application instance may still be running on that version.
Resolve the given path of a bundled file or directory to a path that external processes can read.
If the resource is not packaged into an archive, its path is returned unchanged. Otherwise the copy that the packaging step has left outside of the archive is used, if it is complete, and the resource is extracted from the archive into the configuration directory as a last resort.
Results are cached, so that a resource is extracted at most once per application version.
the path of the bundled resource, typically resolved against __dirname.
the path to use outside of the application.
Provides paths to resources that are bundled with the application, in a form that can also be used by processes which do not run inside the application, such as shells, debug adapters or other external tools.
When an Electron application is packaged with
asar: true, the resources of the application are stored in anapp.asararchive. Paths pointing into such an archive can only be read through Electron's patchedfsmodule, so handing them to an external process fails. Therefore, always resolve a bundled resource through this service before passing its path to a process outside of the application.