{"id":19793567,"url":"https://github.com/darky/node-remote-repl","last_synced_at":"2025-05-01T02:30:43.848Z","repository":{"id":42717260,"uuid":"253250907","full_name":"darky/node-remote-repl","owner":"darky","description":"Node.js remote code execution via inspect protocol for REPL driven development","archived":false,"fork":false,"pushed_at":"2024-06-18T08:40:20.000Z","size":183,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T21:52:20.196Z","etag":null,"topics":["execution","inspect","node","nodejs","remote","repl"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/darky.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":"2020-04-05T14:13:31.000Z","updated_at":"2025-01-26T22:09:25.000Z","dependencies_parsed_at":"2024-06-17T10:39:03.364Z","dependency_job_id":null,"html_url":"https://github.com/darky/node-remote-repl","commit_stats":{"total_commits":60,"total_committers":2,"mean_commits":30.0,"dds":0.01666666666666672,"last_synced_commit":"0bd445ea8f060fb49ed2cb229c10ce6c35ce4489"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fnode-remote-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fnode-remote-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fnode-remote-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darky%2Fnode-remote-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darky","download_url":"https://codeload.github.com/darky/node-remote-repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812265,"owners_count":21647875,"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":["execution","inspect","node","nodejs","remote","repl"],"created_at":"2024-11-12T07:10:25.610Z","updated_at":"2025-05-01T02:30:43.566Z","avatar_url":"https://github.com/darky.png","language":"TypeScript","readme":"# node-remote-repl\n\nExecute code remotelly via Node.js inspect protocol like Clojure nREPL. Primary usage for REPL driven development.\n\n### Install\n\n```\nnpm install -g node-remote-repl\n```\n\n### Usage\n\nYou can always get help of cli:\n\n```\nnode-remote-repl --help\n```\n\nOutput:\n\n```\nUsage: node-remote-repl [options] \u003cfile\u003e\n\nOptions:\n  -V, --version        output the version number\n  -h, --host \u003cstring\u003e  host of inspect protocol (default: \"localhost\")\n  -p, --port \u003cnumber\u003e  port of inspect protocol (default: 9229)\n  -h, --help           display help for command\n```\n\nOk, it's very easy, create for example `repl.js` and play with it\n\n```\nnode-remote-repl --host some-host --port 9229 repl.js\n```\n\nAlso TypeScript supported too\n\n```\nnode-remote-repl --host some-host --port 9229 repl.ts\n```\n\nIf you want to use fast TypeScript compiler\n\n```\nUSE_SWC=1 node-remote-repl --host some-host --port 9229 repl.ts\n```\n\n*For TypeScript support should be installed **typescript** or **@swc/core** (when USE_SWC=1) in your `devDependencies`*\n\n### Some use cases\n\n#### log to stdout of your remote process\n\n```js\nconsole.log(/* some stuff */);\n```\n\n#### expose something from remote process\n\n```js\nexports.$repl = async () =\u003e {\n  return 1 + 1;\n};\n```\n\n#### expose some json from remote process\n\n```js\nexports.$replJson = async () =\u003e {\n  return {obj: true};\n};\n```\n\n#### use power of require\n\n```js\nconst util = require('util');\nconst module = require('./some-module');\n\nexports.$repl = async () =\u003e {\n  return util.inspect(module.method(), {colors: true});\n};\n```\n\n#### typescript support out of the box\n\n```ts\nexports.$repl = async () =\u003e {\n  const n: number = 1;\n  return n;\n};\n```\n\n#### you can replace implementation on remote side\n\n```js\nconst Module = require('./some-module');\nModule.prototype.method = () =\u003e {\n  // replace implementation on the fly\n};\n```\n\n### Integration with IDE\n\nBecause it simple command line util, you can easy integrate it with your IDE.\nFor example let's do it with Visual Studio Code and Code Runner extension:\n\n* install Code Runner extension to Visual Studio Code\n* configure Code Runner to run `node-remote-repl` in `repl.js`:\n\n```json\n{\n  \"code-runner.executorMapByGlob\": {\n    \"repl.js\": \"node-remote-repl --host some-host --port 9229\"\n  }\n}\n```\n\n* profit, now you can fastly run repl via Visual Studio Code\n* I hope, some similar stuff exists on all popular IDE\n\n### Related\n\n* [repl-ns](https://github.com/darky/repl-ns) - \nNamespace for REPL driven development for TypeScript/JavaScript, inspired by Clojure namespaces\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fnode-remote-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarky%2Fnode-remote-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarky%2Fnode-remote-repl/lists"}