Skip to content

Mounting "tar indexed" file images from JS #553

Open
@gergness

Description

@gergness

From R, it's possible to mount the ".tar.gz" files with the metadata added via rwasm::add_tar_index(), but I haven't been able to from javascript's webR.FS.mount. Looking closer at the documentation, I only see an example with the separate metadata, am I missing something, or any way to access the webr package's extraction tools from JS?

I'm new enough at JS that I don't know a way to give a self contained example, but I'm essentially trying this:


                const response = await fetch("/file.tar.gz);

                const options = {
                  packages: [{
                    blob: await response.blob(),
                    //metadata: await metadata.json(),
                  }],
                }
                await webR.FS.mount("WORKERFS", options, '/path');

(My ultimate goal is to parallelize the HTTP requests to see if it will be faster, so I want to use JS fetch instead of webr::mount() which does sequential HTTP requests)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions