The core modules of coursier are cross-compiled and published for Scala.js. This allows to run resolutions from Node.js or from the browser, via Scala.js. Note that only the core module of coursier, running resolutions, is cross-compiled. The cache module is not, so that one cannot rely on the cache of coursier from Scala.js.
As a substitute to the cache module, a module named
is published for Scala.js, allowing one to fetch metadata and possibly
artifacts via XMLHttpRequests.
From sbt, one can depend on the core and fetch modules via
libraryDependencies ++= Seq( "io.get-coursier" %%% "coursier-core" % "1.1.0-M11", "io.get-coursier" %%% "coursier-fetch-js" % "1.1.0-M11" )
or simply via the
coursier module, which aggregates both,
libraryDependencies += "io.get-coursier" %%% "coursier" % "1.1.0-M11"
As an illustration, coursier has an in-browser demo, that allows one to run resolutions entirely from the browser.