esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

list of all submodules for a package

Open Corei13 opened this issue 4 months ago • 3 comments

I am running a self-hosted version of esm, and for certain package(s), I want to build all submodules of a package ahead of time.

Is there a way, given a package name, to list all the submodule that could be built for the package?

Eg:

GET https://esm.sh/~list/jotai

[
  "/",
  "/react",
  "/vanilla",
]

Corei13 avatar Aug 19 '25 07:08 Corei13

GET https://esm.sh/jotai/

[
  "react",
  "vanilla",
]

How about using tailing splash?

ije avatar Aug 19 '25 07:08 ije

That works!

Alternatively, it could also be a parameter of /package.json, eg:

GET https://esm.sh/[email protected]/package.json?include=modules

{
  "name": "jotai",
  "description": "👻 ..."
  ...
  "modules": ["/", "/react", "/vanilla"]
}

Corei13 avatar Aug 19 '25 08:08 Corei13

Hey @ije is it feasible to implement? If you can share some pointer, I can also get my team to attempt and start a PR.

Corei13 avatar Sep 06 '25 06:09 Corei13