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
fetch-js 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
resolvers += Resolver.sonatypeRepo("snapshots") libraryDependencies ++= Seq( "io.get-coursier" %%% "coursier-core" % "2.0.0-RC2-2+8-89ce8126-SNAPSHOT", "io.get-coursier" %%% "coursier-fetch-js" % "2.0.0-RC2-2+8-89ce8126-SNAPSHOT" )
or simply via the
coursier module, which aggregates both,
resolvers += Resolver.sonatypeRepo("snapshots") libraryDependencies += "io.get-coursier" %%% "coursier" % "2.0.0-RC2-2+8-89ce8126-SNAPSHOT"
As an illustration, coursier has an in-browser demo, that allows one to run resolutions entirely from the browser.