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.