{"id":24788030,"url":"https://github.com/kamdz/console-link","last_synced_at":"2025-10-12T11:31:56.460Z","repository":{"id":274246061,"uuid":"922347392","full_name":"kamdz/console-link","owner":"kamdz","description":"🔗 Effortlessly stream client-side `console.log` messages to your server-side terminal via WebSocket.","archived":false,"fork":false,"pushed_at":"2025-01-26T00:40:16.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-26T00:50:27.807Z","etag":null,"topics":["console","debugging","logging","terminal"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/console-link","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/kamdz.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":"2025-01-26T00:20:56.000Z","updated_at":"2025-01-26T00:40:47.000Z","dependencies_parsed_at":"2025-01-26T00:50:49.928Z","dependency_job_id":"f6ed42c6-bda3-432b-b09a-6602972f913c","html_url":"https://github.com/kamdz/console-link","commit_stats":null,"previous_names":["kamdz/console-link"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Fconsole-link","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Fconsole-link/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Fconsole-link/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamdz%2Fconsole-link/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamdz","download_url":"https://codeload.github.com/kamdz/console-link/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236210662,"owners_count":19112872,"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":["console","debugging","logging","terminal"],"created_at":"2025-01-29T16:14:41.526Z","updated_at":"2025-10-12T11:31:56.110Z","avatar_url":"https://github.com/kamdz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔗 console-link\n\nEffortlessly stream client-side `console.log` messages to your server-side terminal via WebSocket. Debugging across environments has never been easier!  \nThis is just a proof of concept and intended only for development purposes. Works only on localhost.\n\n## 🚀 Features\n\n- **Global override** – Redirect all console methods (e.g., `console.log`, `console.error`) to the terminal without modifying your code.\n- **Multiple integration options** – Choose from three simple methods to integrate.\n- **Real-time streaming** – Logs are instantly sent from the client to the server.\n- **Queueing** – Ensures no logs are lost, even if the WebSocket connection isn't ready.\n\n## 🛠️ Installation\n\n```bash\nnpm install -g console-link\n```\n\n## 📖 Usage\n\n### In the terminal:\n\n```bash\nconsole-link\n# Or run directly without preinstallation\nnpx console-link\n```\n\n### On the client-side (choose one):\n\n#### 1. Node.js (e.g., React)\n\n```typescript\nimport 'console-link';\n\n// Now all console messages will be forwarded to the server.\n```\n\n#### 2. HTML\n\n```html\n\u003cscript src=\"https://www.unpkg.com/console-link\"\u003e\u003c/script\u003e\n```\n\n#### 3. Paste in DevTools\n\nSimply copy the distributed code (available at [https://www.unpkg.com/console-link](https://www.unpkg.com/console-link)) and paste it into your browser's DevTools console.\n\n## ⚙️ Port Customization\n\nNeed to configure a specific port for your WebSocket server? Start by specifying the port directly when running the command:\n\n```bash\nconsole-link [PORT_NUMBER]\n```\n\nReplace `[PORT_NUMBER]` with any available port you need. For example:\n\n```bash\nconsole-link 2137\n```\n\nThis starts the WebSocket server on port `2137`.\nIf you'd like to set a custom port interactively on the client side, simply use `console-link/prompt` instead of `console-link`. For example:\n\n```typescript\nimport 'console-link/prompt';\n```\n\nor include it in your HTML:  \n\n```html\n\u003cscript src=\"https://www.unpkg.com/console-link/dist/prompt.js\"\u003e\u003c/script\u003e\n```  \n\n\u003e **Note**: Make sure to use the full URL (`https://www.unpkg.com/console-link/dist/prompt.js`) as the shorter link (`https://www.unpkg.com/console-link/prompt`) doesn't work.\n\n## 🧠 How It Works\n\n1. The command in the terminal starts a WebSocket server.\n2. The client-side script establishes a WebSocket connection to the server and overrides `window.console` using a Proxy.\n3. Logs are serialized using `flatted` to handle circular references.\n4. The server listens for incoming messages and prints them to the terminal.\n\n## ✨ Example\n\n### Client\n\n```typescript\nconsole.log('App started');\nconsole.warn('Something might be wrong');\nconsole.error('An error occurred');\n```\n\n### Terminal Output\n\n```bash\n\u003e console-link is running on ws://localhost:5001\n\u003e console-link client connected\nApp started\nSomething might be wrong\nAn error occurred\n\u003e console-link client disconnected\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamdz%2Fconsole-link","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamdz%2Fconsole-link","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamdz%2Fconsole-link/lists"}