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 3 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

any progress or demo/examples on this? thanks

archywillhe avatar Oct 15 '23 18:10 archywillhe

No, there hasn't been any work on this since creating the issue. The best "documentation" right now is the code in the repo (index-first.js, index-last.js, rainbow-node.js).

rocketnia avatar Oct 24 '23 21:10 rocketnia

To make it slightly easier to channel effort on this whenever someone is motivated to work on it, I'll note this issue is related to:

  • https://github.com/arclanguage/anarki/issues/227

rocketnia avatar Oct 24 '23 21:10 rocketnia

i see. thanks

archywillhe avatar Oct 27 '23 00:10 archywillhe