rainbow-js icon indicating copy to clipboard operation
rainbow-js copied to clipboard

Document how to use as a JS library with `require("rainbow-js-arc")`

Open rocketnia opened this issue 2 years ago • 4 comments

We should document the library people get when they require("rainbow-js-arc") from a Node.js program. This is the API surface area that should be documented:

const rainbowLibrary = require("rainbow-js-arc");

const rainbowInstance =
    rainbowLibrary.makeRainbow(
       System_in, System_out, System_err, System_getenvAsync0,
       System_getenvAsync1, System_exitAsync, System_fs);

const rainbowInstance2 =
    rainbowLibrary.makeNodeRainbow(stdin, getStdout, getStderr);

const rainbowInstance3 = rainbowLibrary.getSharedRainbow();

The documentation for makeRainbow() is bound to be the most complex part. If possible, we should document it thoroughly enough that people can write their own I/O systems for Rainbow.js like index-first.js, index-last.js, and rainbow-node-src.js do.

rocketnia avatar Jan 08 '22 08:01 rocketnia