{"id":15225223,"url":"https://github.com/sscaff1/bs-node-readline","last_synced_at":"2025-04-09T19:09:34.732Z","repository":{"id":96768183,"uuid":"139855772","full_name":"sscaff1/bs-node-readline","owner":"sscaff1","description":"Node readline bindings for BuckleScript","archived":false,"fork":false,"pushed_at":"2020-02-08T01:55:17.000Z","size":46,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T19:09:29.328Z","etag":null,"topics":["bucklescript","bucklescript-bindings","nodejs","reasonml"],"latest_commit_sha":null,"homepage":"","language":"Reason","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sscaff1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-05T13:45:32.000Z","updated_at":"2020-10-11T15:56:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecfa4d43-4327-4f5a-845b-6a54a69dcb51","html_url":"https://github.com/sscaff1/bs-node-readline","commit_stats":{"total_commits":8,"total_committers":3,"mean_commits":"2.6666666666666665","dds":0.375,"last_synced_commit":"bd5b4ce040bc7067c70a2535356243e71e98f925"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sscaff1%2Fbs-node-readline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sscaff1%2Fbs-node-readline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sscaff1%2Fbs-node-readline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sscaff1%2Fbs-node-readline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sscaff1","download_url":"https://codeload.github.com/sscaff1/bs-node-readline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094993,"owners_count":21046770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bucklescript","bucklescript-bindings","nodejs","reasonml"],"created_at":"2024-09-28T18:05:12.374Z","updated_at":"2025-04-09T19:09:34.686Z","avatar_url":"https://github.com/sscaff1.png","language":"Reason","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bs-node-readline\n\nLow level bindings for Node's readline\n\n## Example\n\n```reason\nlet options =\n  Readline.interfaceOptions(\n    ~input=[%raw \"process.stdin\"],\n    ~output=[%raw \"process.stdout\"],\n    (),\n  );\n\nlet readline = Readline.createInterface(options);\nlet yes = [%re \"/yes|y/gi\"];\nlet no = [%re \"/no|n/gi\"];\n\nreadline\n|. Readline.question(\"Is ReasonML and BuckleScript awesome? \", answer =\u003e {\n     switch (answer) {\n     | a when Js.Re.test(a, yes) =\u003e print_endline(\"You know it!\")\n     | a when Js.Re.test(a, no) =\u003e\n       print_endline(\"You need to revaluate your answer\")\n     | a =\u003e\n       print_endline({j| I don't have a variant for your answer 😦: $a |j})\n     };\n     Readline.close(readline);\n   });\n```\n\nthen you can run the compiled JS file with Node:\n\u003cimg src=\"./Screen Shot 2018-07-05 at 8.46.24 AM.png\" alt=\"Example of binding\" /\u003e\n\n## Installation\n\n```sh\nnpm i --save bs-node-readline\n```\n\nthen add\nThen add `bs-node-readline` to `bs-dependencies` in your `bsconfig.json`:\n\n```js\n{\n  ...\n  \"bs-dependencies\": [\"bs-node-readline\"]\n}\n```\n\n## Usage\n\nSee example in `example/example.re`. Follows the NodeJS API found here: https://nodejs.org/api/readline.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsscaff1%2Fbs-node-readline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsscaff1%2Fbs-node-readline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsscaff1%2Fbs-node-readline/lists"}