Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rocketnia opened this issue Jan 8, 2022 · 4 comments
Open

Comments

@rocketnia
Copy link
Member

rocketnia commented Jan 8, 2022

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.

@archywillhe
Copy link

any progress or demo/examples on this? thanks

@rocketnia
Copy link
Member Author

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
Copy link
Member Author

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:

@archywillhe
Copy link

i see. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants