Theia API Documentation v1.77.0
    Preparing search index...

    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 an app.asar archive. Paths pointing into such an archive can only be read through Electron's patched fs module, 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.

    interface BundledResourceProvider {
        resolveExternalPath(resourcePath: string): Promise<string>;
    }

    Implemented by

    Index
    • 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.

      Parameters

      • resourcePath: string

        the path of the bundled resource, typically resolved against __dirname.

      Returns Promise<string>

      the path to use outside of the application.

      if the resource does not exist or cannot be made available.