{"id":24206369,"url":"https://github.com/open-tech-foundation/react-node-repl","last_synced_at":"2026-04-13T14:31:56.888Z","repository":{"id":223573057,"uuid":"760410165","full_name":"Open-Tech-Foundation/react-node-repl","owner":"Open-Tech-Foundation","description":"The Node.js REPL in a React component.","archived":false,"fork":false,"pushed_at":"2024-04-07T15:41:20.000Z","size":469,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-23T07:58:40.258Z","etag":null,"topics":["console","nodejs","react","repl","sandbox","terminal","webcontainer"],"latest_commit_sha":null,"homepage":"https://node-repl.pages.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Open-Tech-Foundation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2024-02-20T11:18:49.000Z","updated_at":"2025-07-04T18:40:58.000Z","dependencies_parsed_at":"2024-04-07T06:23:31.137Z","dependency_job_id":"d43e1cec-dbed-4815-a29f-b60d03b55a96","html_url":"https://github.com/Open-Tech-Foundation/react-node-repl","commit_stats":null,"previous_names":["open-tech-foundation/react-node-repl"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/Open-Tech-Foundation/react-node-repl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Freact-node-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Freact-node-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Freact-node-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Freact-node-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Open-Tech-Foundation","download_url":"https://codeload.github.com/Open-Tech-Foundation/react-node-repl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-Tech-Foundation%2Freact-node-repl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31757477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["console","nodejs","react","repl","sandbox","terminal","webcontainer"],"created_at":"2025-01-14T00:20:18.575Z","updated_at":"2026-04-13T14:31:56.857Z","avatar_url":"https://github.com/Open-Tech-Foundation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"left\" src=\"https://open-tech-foundation.pages.dev/img/Logo.svg\" width=\"50\" height=\"50\"\u003e\n\n\u0026nbsp;[OPEN TECH FOUNDATION](https://open-tech-foundation.pages.dev/)\n\n\u003cdiv align=\"center\"\u003e\n\n# React Node REPL\n\n![Demo](./assets/Demo.png)\n\n\u003c/div\u003e\n\n\u003e The Node.js [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) in a React component.\n\n\u003cdiv align=\"center\"\u003e\n\n# [Live Demo](https://node-repl.pages.dev/) | [Documentation](https://node-repl.pages.dev/docs)\n\n\u003c/div\u003e\n\n## Features\n\n- Simple API\n- Powered by [WebContainers](https://webcontainers.io/)\n- Install npm packages locally, directly in the terminal\n- Switch between `Terminal` or `Console` View\n- Keyboard shortcuts\n- TypeScript support\n\n## Upcoming\n\n- Serialization of objects for better console view\n- Code formating\n- Syntax errors highlighting\n- TypeScript errors\n\n## Requirements\n\n- Your site must be served over \u003cstrong\u003eHTTPS\u003c/strong\u003e.\n- The following headers must be set in your deployed page.\n\n```text\nCross-Origin-Embedder-Policy: require-corp\nCross-Origin-Opener-Policy: same-origin\n```\n\n\u003ca href=\"https://webcontainers.io/guides/configuring-headers\"\u003e\nLearn more.\n\u003c/a\u003e\n\n## Installation\n\n```shell\nnpm install @opentf/react-node-repl\n```\n\n```shell\nyarn add @opentf/react-node-repl\n```\n\n```shell\npnpm add @opentf/react-node-repl\n```\n\n```shell\nbun add @opentf/react-node-repl\n```\n\n## Usage\n\n```jsx\nimport { NodeREPL } from \"@opentf/react-node-repl\";\nimport \"@opentf/react-node-repl/lib/style.css\";\n\nexport default function App() {\n  const code = `console.log(\"Hello World\")`;\n  const deps = [\"pkg1\", \"pkg2@1.2.3\", \"pkg3@beta\"];\n\n  return \u003cNodeREPL code={code} deps={deps} layout=\"SPLIT_PANEL\" /\u003e;\n}\n```\n\n## API\n\n### Props\n\n| Prop      | Type                | Required | Default   | Description                                                                                                      |\n| --------- | ------------------- | -------- | --------- | ---------------------------------------------------------------------------------------------------------------- |\n| code      | string              | No       | \"\"        | The main code to execute                                                                                         |\n| deps      | string[]            | No       | []        | The npm dependencies.Eg: ['lodash', 'chalk@4.1.2']                                                               |\n| setupCode | string              | No       | \"\"        | The setup code, used to init some values. \u003cbr/\u003eEg: const log = console.log                                       |\n| layout    | string              | No       | \"DEFAULT\" | The predefined layouts for the components.\u003cbr/\u003eThere are two types of layout: \u003cbr/\u003e1. DEFAULT\u003cbr/\u003e2. SPLIT_PANEL |\n| editor    | EditorProps         | No       | undefined | The editor component config.                                                                                     |\n| terminal  | TerminalProps       | No       | undefined | The terminal component config.                                                                                   |\n| console   | ConsoleProps        | No       | undefined | The console component config.                                                                                    |\n| style     | React.CSSProperties | No       | {}        | It is used to style the component container.                                                                     |\n\n### EditorProps\n\n| Prop     | Type                | Required | Default | Description                               |\n| -------- | ------------------- | -------- | ------- | ----------------------------------------- |\n| header   | boolean             | No       | true    | Show / Hide the editor header component.  |\n| darkMode | boolean             | No       | false   | The editor dark mode toggle.              |\n| style    | React.CSSProperties | No       | {}      | It is used to style the editor container. |\n\n### TerminalProps\n\n| Prop  | Type                | Required | Default | Description                                 |\n| ----- | ------------------- | -------- | ------- | ------------------------------------------- |\n| show  | boolean             | No       | true    | Show / Hide the terminal component.         |\n| style | React.CSSProperties | No       | {}      | It is used to style the terminal container. |\n\n### ConsoleProps\n\n| Prop  | Type                | Required | Default | Description                                |\n| ----- | ------------------- | -------- | ------- | ------------------------------------------ |\n| show  | boolean             | No       | true    | Show / Hide the console component.         |\n| style | React.CSSProperties | No       | {}      | It is used to style the console container. |\n\n## Limitations\n\n- Currently, it runs only Node.js v18\n- By default, in REPL mode, you cannot use import statements. You need to fallback to require().\n- You can run ESM modules manually in the terminal with the ESM switch on. Eg: `$ node main.js`\n- It is not possible to run [native addons](https://nodejs.org/api/addons.html).\n\n## Related\n\n- [@opentf/react-sandbox](https://github.com/Open-Tech-Foundation/react-sandbox) - The CodeSandbox sandpack wrapper with additional features.\n\n- [@opentf/react-state](https://react-app-state.pages.dev/) - A global state manager for React.\n\n- [@opentf/react-form](https://react-form.pages.dev/) - A simple form state manager for React.\n\n- [@opentf/std](https://js-std.pages.dev/) - An Extensive JavaScript Standard Library.\n\n## License\n\nCopyright (c) 2021, [Thanga Ganapathy](https://github.com/Thanga-Ganapathy) ([MIT License](./LICENSE)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-tech-foundation%2Freact-node-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-tech-foundation%2Freact-node-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-tech-foundation%2Freact-node-repl/lists"}