{"id":21570393,"url":"https://github.com/arirusso/web-repl","last_synced_at":"2025-04-10T14:12:43.859Z","repository":{"id":15617399,"uuid":"18353891","full_name":"arirusso/web-repl","owner":"arirusso","description":"Javascript/Web REPL in Ruby","archived":false,"fork":false,"pushed_at":"2017-04-12T14:55:07.000Z","size":36,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T12:56:20.729Z","etag":null,"topics":["chrome","javascript","repl","ruby","socket","sockets","webrepl","websockets"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arirusso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-02T03:51:04.000Z","updated_at":"2020-01-01T14:52:27.000Z","dependencies_parsed_at":"2022-07-30T02:07:53.934Z","dependency_job_id":null,"html_url":"https://github.com/arirusso/web-repl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fweb-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fweb-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fweb-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arirusso%2Fweb-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arirusso","download_url":"https://codeload.github.com/arirusso/web-repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247867363,"owners_count":21009240,"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":["chrome","javascript","repl","ruby","socket","sockets","webrepl","websockets"],"created_at":"2024-11-24T11:12:31.277Z","updated_at":"2025-04-10T14:12:43.833Z","avatar_url":"https://github.com/arirusso.png","language":"Ruby","readme":"# web-repl\n\nA Javascript [REPL](http://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) that runs in Ruby.  Evaluation is done by a web browser instance.\n\nOne use of this is to replace the Chrome Developer Console remotely as such:\n\n![image](http://i.imgur.com/7bdJlNC.png)\n\n#### Background\n\nI've been working on a toy project recently that requires browser content to be in fullscreen.  This makes live coding using the regular Chrome JS console more or less impossible.  I came up with web-repl as an alternative.\n\nThere are similar tools that run in nodejs and other languages but this is convenient for me because my project uses a Ruby backend anyway.\n\nUnder the hood, communication is done with JSON over Websocket. Note that there's no extra attention to security here other than what is generally implicit with a Websocket, so please use at your own discretion.  \n\n#### Usage\n\n###### Browser\n\nTo enable the browser side of this, include something like this in the head of your webpage:\n\n```html\n\u003cscript src=\"js/replConnection.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\"\u003e\n  window.onload = function() {\n    var repl = new ReplConnection(\"localhost\", 9007, { debug: true, reconnect: true });\n    repl.start();\n  }\n\u003c/script\u003e\n```\n\nThe javascript assets for this project are located in the [/js directory](https://github.com/arirusso/web-repl/tree/master/js).\n\nThere is also a full example of a webpage (with simple [rack](http://rack.github.io/) webserver configuration) in the [/examples/page directory](https://github.com/arirusso/web-repl/tree/master/examples/page)\n\n###### REPL\n\nThe REPL can be used either in a Ruby program/console or there is a \"binary\" Ruby script.\n\nIn Ruby the usage looks like this:\n\n```ruby\nrequire \"web-repl\"\n\nWebRepl.start(:host =\u003e \"localhost\", :port =\u003e 9007)\n```\n\nYou can see an explanation of [background usage here](https://github.com/arirusso/web-repl/blob/master/examples/background.rb).\n\nTo use this as a script, run this from the command line.  (The script should install with the gem)\n\n    web-repl localhost:9007\n\n#### Installation\n\n    gem install web-repl\n\nor with Bundler\n\n    gem \"web-repl\"\n\n#### License\n\nLicensed under Apache 2.0, See the file LICENSE\n\nCopyright (c) 2014-2015 [Ari Russo](http://arirusso.com) \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farirusso%2Fweb-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farirusso%2Fweb-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farirusso%2Fweb-repl/lists"}