-
Notifications
You must be signed in to change notification settings - Fork 0
cli help
to assist with embedded spaces created by Generative Artificial Intelligence (GenAI)
cli = await import('https://epiverse.github.io/cli/cli.mjs')Once you load the SDK you can access its methods, such as asking for help,
You can use the cli.help() to open this documentation wiki page. Note also you can also use it to report issues in that page.
cli.help()the cli SDK was developed entirely as a in-browser JavaScript Software Development Kit (SDK), using ES6 modules. A a matter of style, the ES6 modules are, as much as possible, imported dynamically close to the point where the module is needed. Let's illustrate this point for reading compressed data files.
This function can be pointed to a compressed (zipped) data file URL to decompress it, followed by a JSON type check. If JSON is not found to be the type then the underlying text will be returned as is. In this illustrative example, the default URL value is "https://raw.githubusercontent.com/epiverse/pathembed/refs/heads/main/tcgaSlideEmbeddings.json.zip", containing 1833 whole slide embeddings.
url = "https://raw.githubusercontent.com/epiverse/pathembed/refs/heads/main/tcgaSlideEmbeddings.json.zip"and therefore
docs = await cli.unzipURL(url)will produce the data same JSON structure as
docs = await cli.unzipURL(). // url missing, so the default value will be used. Finally, there is an expectation that each command can be called directly from the console, without a separate import call to the SDK:
docs = await (await import('https://epiverse.github.io/cli/cli.mjs')).unzipURL()For dramatic effect give it a try in the console of NYTimes.
Note how dynamic import is used not only to modularize individual calls, but also to rely on as-needed module imports. See, for example, how the second line of the function unzipURL satisfies a dependency on the JSZip module, only when needed. Note the modern design of JS loads modules only once. As a consequence, in this example, if the analysis does not include compressed data files, the JSZIP dependency doesn't exist, and therefore won't be imported.