Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS implementation #7

Open
jaimergp opened this issue Feb 6, 2024 · 0 comments
Open

JS implementation #7

jaimergp opened this issue Feb 6, 2024 · 0 comments

Comments

@jaimergp
Copy link
Collaborator

jaimergp commented Feb 6, 2024

It should be possible to fetch .conda metadata (.tar.bz2 can't be streamed) with JS only. This works on the browser:

import { RemoteZipPointer } from "@basisai/remote-zip";

(async () => {
    const url = new URL("https://conda.anaconda.org/conda-forge/linux-64/des-fitvd-0.9.19-py39hf3d152e_2.conda");
    const remoteZip = await new RemoteZipPointer({ url }).populate();
    const fileListing = remoteZip.files(); // RemoteZipFile[]
    console.log(fileListing);
})();

Resulting in:

[
    {
        "filename": "metadata.json",
        "size": 31,
        "modified": "2024-02-06T18:29:10",
        "attributes": 25165824
    },
    {
        "filename": "pkg-des-fitvd-0.9.19-py39hf3d152e_2.tar.zst",
        "size": 93411,
        "modified": "1980-01-01T00:00:00",
        "attributes": 25165824
    },
    {
        "filename": "info-des-fitvd-0.9.19-py39hf3d152e_2.tar.zst",
        "size": 8325,
        "modified": "1980-01-01T00:00:00",
        "attributes": 25165824
    }
]

Paired with a zst library, we should be able to fetch the info/ bits like conda-package-streaming does. This could be implemented in the conda-forge.org website and only point here for the .tar.bz2 bits (which are provided by the OCI backend).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant