{"id":21359239,"url":"https://github.com/thomaschampagne/promise-tron","last_synced_at":"2026-05-01T04:34:23.963Z","repository":{"id":38427519,"uuid":"182399407","full_name":"thomaschampagne/promise-tron","owner":"thomaschampagne","description":"PromiseTron is a promise based communication system which simplify data exchange between electron main and renderer processes","archived":false,"fork":false,"pushed_at":"2023-04-30T23:47:18.000Z","size":4273,"stargazers_count":1,"open_issues_count":42,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-01-22T18:51:40.097Z","etag":null,"topics":["electron","ipcmain","ipcrenderer","promise"],"latest_commit_sha":null,"homepage":"https://thomaschampagne.github.io/promise-tron/","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/thomaschampagne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","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":"2019-04-20T11:48:00.000Z","updated_at":"2021-02-14T19:21:35.000Z","dependencies_parsed_at":"2024-11-22T07:03:13.393Z","dependency_job_id":null,"html_url":"https://github.com/thomaschampagne/promise-tron","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.0714285714285714,"last_synced_commit":"5788fe8b95428cea0d5748cd2e85eb7a1cab6c1a"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Fpromise-tron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Fpromise-tron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Fpromise-tron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaschampagne%2Fpromise-tron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomaschampagne","download_url":"https://codeload.github.com/thomaschampagne/promise-tron/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243834855,"owners_count":20355504,"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":["electron","ipcmain","ipcrenderer","promise"],"created_at":"2024-11-22T05:27:13.268Z","updated_at":"2026-05-01T04:34:18.913Z","avatar_url":"https://github.com/thomaschampagne.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promise tron\nPromiseTron is a promise based communication system library which simplify data exchange between electron main and renderer processes.\n\nPromiseTron includes **typescript** definitions.\n\nApi doc: [https://thomaschampagne.github.io/promise-tron/](https://thomaschampagne.github.io/promise-tron/)\n\n## Install\n\n```bash\nnpm install promise-tron --save\n```\n\nor\n\n```bash\ngit clone https://github.com/thomaschampagne/promise-tron\ncd promise-tron\nnpm install\nnpm run build\n```\n\n## Usage\n\n### Message from ipcRenderer to ipcMain\n\n```javascript\n\nimport { BrowserWindow, ipcMain, ipcRenderer } from \"electron\";\nimport { PromiseTron } from \"promise-tron\";\n\n// Renderer\nconst promiseTronRenderer = new PromiseTron(ipcRenderer);\npromiseTronRenderer.send('Hi from renderer!').then(response =\u003e {\n  console.log(response); // Prints: \"Reply from ipcMain\"\n}, error =\u003e {\n  console.error(error);\n});\n\n// Main\nconst browserWindow = new BrowserWindow();\nconst promiseTronMain = new PromiseTron(ipcMain, browserWindow.webContents);\npromiseTronMain.on((request /*IpcRequest*/, replyWith /*(promiseTronReply: PromiseTronReply) =\u003e void*/) =\u003e {\n  console.log(request.data); // Prints: \"Hi from renderer!\"\n  replyWith({\n    success: 'Reply from ipcMain',\n    error: null\n  });\n});\n\n```\n\n### Message from ipcMain to ipcRenderer\n\n```javascript\nimport { BrowserWindow, ipcMain, ipcRenderer } from 'electron'\nimport { PromiseTron } from 'promise-tron'\n\n// Main\nconst browserWindow = new BrowserWindow();\nconst promiseTronMain = new PromiseTron(ipcMain, browserWindow.webContents);\npromiseTronMain.send('Hi from main!').then(response =\u003e {\n  console.log(response); // Prints: \"Reply from ipcRenderer\"\n}, error =\u003e {\n  console.error(error);\n});\n\n\n// Renderer\nconst promiseTronRenderer = new PromiseTron(ipcRenderer);\npromiseTronRenderer.on((request /*IpcRequest*/, replyWith /*(promiseTronReply: PromiseTronReply) =\u003e void*/) =\u003e {\n  console.log(request.data); // Prints: \"Hi from main!\"\n  replyWith({\n    success: 'Reply from ipcRenderer',\n    error: null\n  });\n});\n```\n\n## NPM scripts\n\n - `npm test`: Run test suite\n - `npm start`: Run `npm run build` in watch mode\n - `npm run test:watch`: Run test suite in [interactive watch mode](http://facebook.github.io/jest/docs/cli.html#watch)\n - `npm run test:prod`: Run linting and generate coverage\n - `npm run build`: Generate bundles and typings, create docs\n - `npm run lint`: Lints code\n - `npm run commit`: Commit using conventional commit style ([husky](https://github.com/typicode/husky) will tell you to use it if you haven't :wink:)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaschampagne%2Fpromise-tron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomaschampagne%2Fpromise-tron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaschampagne%2Fpromise-tron/lists"}