{"_id":"@axaptional/electron-ipc","_rev":"4-4001599f0e5c9d318939a5569fa9430b","name":"@axaptional/electron-ipc","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@axaptional/electron-ipc","version":"0.2.0","description":"An easy-to-use wrapper around Electron's inter-process communication API","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","lint":"tslint -p tsconfig.json","docs:build":"compodoc -d docs -p tsconfig.json --theme readthedocs","docs:serve":"compodoc -d docs -r 4201 -s -o","docs:review":"npm run doc:build && npm run doc:serve","prepare":"npm run build","prepublishOnly":"npm run lint","preversion":"npm run lint","version":"npm run docs:build && git add -A src docs","postversion":"git push && git push --tags"},"keywords":["electron","ipc","process","communication"],"author":{"name":"André Mategka","email":"12amdeveloper@gmail.com"},"license":"MIT","devDependencies":{"@compodoc/compodoc":"^1.1.8","tslint":"^5.12.1","tslint-config-standard":"^8.0.1","typescript":"^3.3.3"},"optionalDependencies":{"bluebird":"^3.5.3"},"dependencies":{"@types/electron":"^1.6.10","any-promise":"^1.3.0","electron":"^4.0.4","bluebird":"^3.5.3"},"gitHead":"7bc2f08942d22b6cc6a4826d29888658ac0b4b87","_id":"@axaptional/electron-ipc@0.2.0","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"am307","email":"12amdeveloper@gmail.com"},"dist":{"integrity":"sha512-10AhLWznwxHRGpJaRVuH7f8ClMDw4ALLBxoKeSo4heGd2JIOzOkRieiXwC6n3XccQrMmToa+iX4jtSwJ/tRM9w==","shasum":"d62fbaff29bfc776956af13e8da6deda4aacff06","tarball":"https://registry.npmjs.org/@axaptional/electron-ipc/-/electron-ipc-0.2.0.tgz","fileCount":25,"unpackedSize":38830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZ0EaCRA9TVsSAnZWagAASc0QAJjevZ/PTwduFzvWbMdd\nOQ/iZHmSI+DNazZi0tgwNjJOSvXo76YU6nuqIyYkpiHEOu07R4EIq06fi41T\ndawxiZhwMyI78DSu4kMzC+ehHmtG5FJvuQX8aY9x7IBQtcU0sH9RgqfL7viK\nSh1m4RiaT2Sm29+LVbBj2u8Oly79R8pgxOezdhNasQEBFCXS2fuRYYxOjtQv\nBeH75f/7FSgTa/mvylawawjKuJ5F1OhNkvG+73dzSzJ9US3Gp0Klrfa8eRTp\nyggOOnsfLSJUJKxCzxpZ9N7U+Jo5RXVPBgF/D1QMA5cyCYSWFgRV+GVoM6Dy\nEsJZeVy44H9o8r/UWkisXSo+PTsGuOUGKRGbfDhqqI/2/bb8fVQV0+tW2jXd\nBPZOapwkRozwZjPmG6t2ejA2szu1T8cnRQWke9E+cZcKW6o3XrnDTT9xFqUH\nE6d3bakTHXuDplpLLsO7YP+lXlViw/qbSfSqh6eKG646Qkkuq1bUKBokE1uH\n0t+h4u+lyQ9TMrZAAHfFAYAuxMjNXNy2dLFA2YBjXo1kxUOpq609CGek8/3Z\n0E7TDAGHifRtslRrBfvtloww1iC8z7RhjJNEd/soUCqSsyorREndb66SE5RP\n57UjMbBa1kLvA9LcAzvaayXYM3/Mu6t4LSoIg27+XtzaoWydRpCKNj469Qm/\n7Nfa\r\n=8+wt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3zKUBc+hR1QrQybM6g0nwAhjcIP8Ac2Q+3+LnLxV/mwIhAPm1X2NAM8G3Yc3NmmI/xOdzBUHNciRMsAaYJxXuB3wc"}]},"maintainers":[{"name":"am307","email":"12amdeveloper@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-ipc_0.2.0_1550270746051_0.2981743335126499"},"_hasShrinkwrap":false,"deprecated":"This package is currently not maintained."},"0.2.1":{"name":"@axaptional/electron-ipc","version":"0.2.1","description":"An easy-to-use wrapper around Electron's inter-process communication API","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","lint":"tslint -p tsconfig.json","lint:fix":"tslint -p tsconfig.json --fix","docs:build":"compodoc -d docs -p tsconfig.json --theme readthedocs","docs:serve":"compodoc -d docs -r 4201 -s -o","docs:review":"npm run doc:build && npm run doc:serve","prepare":"npm run build","prepublishOnly":"npm run lint","preversion":"npm run lint","version":"git add -A src docs","postversion":"git push && git push --tags"},"keywords":["electron","ipc","process","communication"],"author":{"name":"André Mategka","email":"12amdeveloper@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/axaptional/electron-ipc.git"},"directories":{"lib":"dist","doc":"docs"},"devDependencies":{"@compodoc/compodoc":"^1.1.8","tslint":"^5.12.1","tslint-config-standard":"^8.0.1","typescript":"^3.3.3"},"optionalDependencies":{"bluebird":"^3.5.3"},"dependencies":{"any-promise":"^1.3.0","electron":"^4.0.4","bluebird":"^3.5.3"},"gitHead":"d24068af7d62c6467017a5e5ac0868685977de32","bugs":{"url":"https://github.com/axaptional/electron-ipc/issues"},"homepage":"https://github.com/axaptional/electron-ipc#readme","_id":"@axaptional/electron-ipc@0.2.1","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"am307","email":"12amdeveloper@gmail.com"},"dist":{"integrity":"sha512-w06VfiUpOxK4Utt/QU4AEIJoHOvM/JZ97+1wcc7igXRMB3S7yDUDcmpi1bukKYzWfnAdsp+qc3l2ME9Kf5MfWA==","shasum":"0baf7752d4bb860d49d808610ad7eb95fcf4a874","tarball":"https://registry.npmjs.org/@axaptional/electron-ipc/-/electron-ipc-0.2.1.tgz","fileCount":25,"unpackedSize":41821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcaFrFCRA9TVsSAnZWagAAt2UP/2ce/5ah1uaacQobgUbL\nbi0OGMEy+0cpOdu0qJ8gtbEn7EEHHhgO9XnG7sZvOn1kjxeIE9S8GAmwevKX\nvnUb60VRCxoVeyie0m2GGBd2G1k2vFAo7DEN847RcmvQ5Gcc5qKp4XusKdEw\ntytBU75UYy5G1CTa1BSVVIR2+GXA9u5MvQcc1EA02hLk6FVLMpjJxm2xSGU+\n7SMuoFDdPTr5XgvCWEDVtl069Gcs2ICuOkniweAsQgbpfTZY/QmkxXLyER/b\n1lKRg/0L7AyrYg75aqo199ezT9azC6NoaR11aCQoqX2Fwbvc6ylGVg2CC8hl\nqveWhWpk19/zVlmrCUfG7jTBNRcLu6dQamJVl2fg/FkX7HUYve2O3wFzoCaL\n4HlFSJa87BWD3XUqMA94KdaWcH6FeBqM4FHcTGJAaJ3SH4TzgUrmM16dRPSm\nc+3Wv6G8LFeHpb7XL1vHNiUiU/PUMvAm4yTYl64uwEBXMa007PdTmViReIPE\nI7C55rSA4jEhA2kHLocZMzueh+4dlqjgH0119tbSkuJ+t/BzLQNzQLFfF1wh\nnAa0NZcGa0D43sUzWo82R+Xn1rPX0dfgB58q3hY7bnRvNhhTlIEDPNKnhG3H\nzZ3OEZfGdpnb4qcVLRg+k9v/Bo2sBMjhbDhNQ926TKSGLukoCXL+q5xpdqYI\nSR39\r\n=aA8J\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVB507qa3lWDdodHj/MA33vNyOjTU9YsJfGPBY+FKdqgIgLpa/ciyx5GHqDaOiMfo+7QodAS9Z91XMwUmZ2Swtm6w="}]},"maintainers":[{"name":"am307","email":"12amdeveloper@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-ipc_0.2.1_1550342852606_0.5569387653931819"},"_hasShrinkwrap":false,"deprecated":"This package is currently not maintained."},"0.3.0":{"name":"@axaptional/electron-ipc","version":"0.3.0","description":"An easy-to-use wrapper around Electron's inter-process communication API","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsc","lint":"tslint -p tsconfig.json","lint:fix":"tslint -p tsconfig.json --fix","docs:build":"compodoc -d docs -p tsconfig.json --theme readthedocs","docs:serve":"compodoc -d docs -r 4201 -s -o","docs:review":"npm run doc:build && npm run doc:serve","prepare":"npm run build","prepublishOnly":"npm run lint","upgrade":"npm run lint && npm run build && npm run docs:build && git tag -a v0.3.0 -m \"0.3.0\"","preversion":"npm run lint","version":"git add -A src docs","postversion":"git push && git push --tags"},"keywords":["electron","ipc","process","communication"],"author":{"name":"André Mategka","email":"12amdeveloper@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/axaptional/electron-ipc.git"},"directories":{"lib":"dist","doc":"docs"},"devDependencies":{"@compodoc/compodoc":"^1.1.8","tslint":"^5.12.1","tslint-config-standard":"^8.0.1","typescript":"^3.3.3"},"optionalDependencies":{"bluebird":"^3.5.3"},"dependencies":{"any-promise":"^1.3.0","electron":"^4.0.4","bluebird":"^3.5.3"},"gitHead":"585ab46eac64140323ca6f624dfa91f70e7407b7","bugs":{"url":"https://github.com/axaptional/electron-ipc/issues"},"homepage":"https://github.com/axaptional/electron-ipc#readme","_id":"@axaptional/electron-ipc@0.3.0","_npmVersion":"6.5.0-next.0","_nodeVersion":"11.6.0","_npmUser":{"name":"am307","email":"12amdeveloper@gmail.com"},"dist":{"integrity":"sha512-Xw8IbwNP8p1zAPS68+bicy6JRtdvvxIzw9V/9E8XvsrS0FY1BSzHZDhVxwdVdjf7OqExY5VNX8h8XFNQfmS2NQ==","shasum":"cf318d6b009ba6a1413519c45cb44474b18311f7","tarball":"https://registry.npmjs.org/@axaptional/electron-ipc/-/electron-ipc-0.3.0.tgz","fileCount":25,"unpackedSize":42230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcbgUKCRA9TVsSAnZWagAAdmcQAIM6KDWdmAZCHKDWfFPi\ntDgSgeZHcWX8+jd5wD+XjPv5pq9uxNYqgki5Y6VGLBtxA7hJ+KxgwU74Hlw4\n+0yby6bzFS8SB7S2U0xiUt6fU5YaCq28faYIUH/SlpTJrFI5aBODHNL7jcw+\nzvuEdShueuGPtkH6gwfGaKbCw9U+dA6+YGMNNMbOrLcIR/2WLGeJADuiPRUa\nmOw6wCf04HvOa33mRBwxyEzJx6BYgZXkDuqMNffhW1e50jGkqO4yV2H//Qgx\nIc9PpINqYXRONj/QnDMzKT28xoK09I5x/ZmXLWDXX72W3WwMxfSRTvANSi7L\ncHymP/DZU52/aaOReO0MlawPOMsQ+gu8su8QKYWZmqhtmtkMpUJN9y1bKFeM\n1B39S3qWZARvCxTfB6I3A4i/heawBufbMeX9lZMBFokbL44LP6RLh+Ehg9yT\nBK56OqoVaqrRnD2DPJUvApYyfVDoEaSu2NSz/AB5YjZ7yuaDL3/GaChmkXd9\nRRXOqZhHesZwrkZY5aWa4aGnW68Kvdcj2AKjEQLECP2boJCeF+tAMpNzJfOW\nYG8nV2GCub+6/ruH1OBpu1Gd8JC9SH1R51ykg8YOr912aDBbhj8UgklXHXHM\nQft8zjti7fphQmmly9YiOTBxBWrBuLvm6QJwQw/i2omCAzpNM9kokQfq1Nfi\n4FVr\r\n=DVGs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJwSY7BlVbR1uTJvCKtjaWHXXHCkRWd5TYytYQC/HNoAiADi0icGde2nzs3IMQDSjb7twhYveXNjnOhiveiSyj0qg=="}]},"maintainers":[{"name":"am307","email":"12amdeveloper@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/electron-ipc_0.3.0_1550714122053_0.5545289736237489"},"_hasShrinkwrap":false,"deprecated":"This package is currently not maintained."}},"time":{"created":"2019-02-15T22:45:45.852Z","0.2.0":"2019-02-15T22:45:46.167Z","modified":"2022-04-04T17:08:27.801Z","0.2.1":"2019-02-16T18:47:32.755Z","0.3.0":"2019-02-21T01:55:22.242Z"},"maintainers":[{"name":"am307","email":"12amdeveloper@gmail.com"}],"description":"An easy-to-use wrapper around Electron's inter-process communication API","keywords":["electron","ipc","process","communication"],"author":{"name":"André Mategka","email":"12amdeveloper@gmail.com"},"license":"MIT","readme":"# electron-ipc\r\n\r\n[![MIT license][BADGE-LICENSE]][LICENSE]\r\n[![Issues][BADGE-ISSUES]][ISSUES]\r\n[![NPM Version][BADGE-NPM]][NPM]\r\n[![JavaScript Style Guide][BADGE-STANDARD]][STANDARD]\r\n[![Documentation Coverage][BADGE-COVERAGE]][PAGES]\r\n\r\nAn easy-to-use symmetric wrapper around Electron's IPC API\r\n\r\n**Note:**\r\nThis package is still a **work in progress** and should not be used in any\r\nprojects yet, let alone any production environments.\r\n\r\n## Features\r\n\r\nThis package allows you to use a normalized, symmetric API for IPC.\r\nThis means that both the client and server APIs can be used as if they were\r\nexactly the same.\r\n\r\nThe following means of asynchronous communication are currently supported:\r\n\r\n- listeners / callbacks\r\n- native Promises (ES2015+)\r\n- custom Promises (like `bluebird`)\r\n\r\n## Installation\r\n\r\nUse `npm` to install [`@axaptional/electron-ipc`][NPM]:\r\n\r\n```bash\r\n$ npm install @axaptional/electron-ipc\r\n```\r\n\r\n### Extensions\r\n\r\n#### Cancelable Promises\r\n\r\nIf you want to use cancelable Promises, install a Promise library like\r\n[`bluebird`][bluebird] supporting this feature,\r\nthen register your Promise constructor with\r\n[`any-promise`][any-promise] like this:\r\n\r\n```js\r\nrequire('any-promise/register/bluebird');\r\n// or\r\nimport 'any-promise/register/bluebird';\r\n```\r\n\r\nYou will need to register your custom Promise constructor in both the main and\r\nthe renderer process in order to use canceling in both.\r\n`any-promise` is automatically installed since it is a dependency of this\r\npackage.\r\n\r\n#### Observables\r\n\r\n_The extension package for Observable support is not available yet._\r\n\r\nIf you want to use Observables, install\r\n[`@axaptional/electron-ipc-rx`][electron-ipc-rx].\r\nThis package will add `$`-postfix counterparts to most methods,\r\ne.g. `post$(...)`.\r\nKeep in mind that you will need to adjust your imports when switching from\r\nelectron-ipc.\r\n\r\n## Usage\r\n\r\n### Post messages and receive responses\r\n\r\nProbably one of the most prominent use cases is that you want to initiate a\r\nmain process function from the renderer process and do something with the\r\nresult of that function in the renderer process.\r\n\r\n**Renderer Process**\r\n\r\n```js\r\nimport { Client } from '@axaptional/electron-ipc';\r\n\r\nconst client = new Client();\r\n\r\nclient.post('message', 'this').then(response => {\r\n  console.log(response); // Prints \"And here is the reply to this\"\r\n});\r\n```\r\n\r\n**Main Process**\r\n\r\n```js\r\nimport { BrowserWindow } from 'electron';\r\nimport { Server } from '@axaptional/electron-ipc';\r\n\r\nconst myWindow = new BrowserWindow();\r\n// ...\r\n\r\nconst server = new Server(myWindow.webContents);\r\n\r\nserver.on('message', message => {\r\n  return `And here is the reply to ${message}`;\r\n});\r\n```\r\n\r\n### Posting from main and responding from renderer\r\n\r\nIf you want to use IPC in the other direction, _you can_:\r\n\r\nThe APIs for `Client` and `Server` are exactly the same.\r\nFor example, you can also `post` a message from the main process to the\r\nrenderer process, then use `on`/`once` to respond back.\r\nIn the above code, you could just swap all lines after the\r\n`Client` and `Server` initializations to do just that.\r\n\r\n### Serialization\r\n\r\nSince Promises can only resolve to _one_ value and to keep consistency,\r\nonly single-object messages can be posted and received.\r\n\r\nHowever, you may wrap your data in an array or object literal to\r\npost multiple values, then use parameter destructuring on the receiving end,\r\nlike so:\r\n\r\n```js\r\nclient.post('message', ['one', 'two']).then(({ success, text }) => {\r\n  if (success) {\r\n    console.log(text);\r\n  }\r\n});\r\n```\r\n\r\nKeep in mind that any data passed will automatically be serialized to JSON\r\nby Electron.\r\nThis means that values such as functions and classes cannot be passed.\r\n\r\nAlso be aware that objects received by responses via `post` or through channels\r\nvia `on` or `once` will have all class prototype information stripped.\r\n\r\n### Methods\r\n\r\nFor short explanations on available methods, see [Methods][methods].\r\n\r\nFor the code documentation, see [Documentation][PAGES].\r\n\r\n## License\r\n\r\nThis package is available under the [MIT license][LICENSE].\r\n\r\n<!-- Important references -->\r\n[LICENSE]: https://github.com/axaptional/electron-ipc/blob/v0.3.0/LICENSE\r\n[ISSUES]: https://github.com/axaptional/electron-ipc/issues\r\n[NPM]: https://www.npmjs.com/package/@axaptional/electron-ipc\r\n[PAGES]: https://axaptional.github.io/electron-ipc/\r\n[STANDARD]: https://standardjs.com\r\n\r\n<!-- Badges -->\r\n[BADGE-LICENSE]: https://img.shields.io/github/license/axaptional/electron-ipc.svg\r\n[BADGE-ISSUES]: https://img.shields.io/github/issues/axaptional/electron-ipc.svg\r\n[BADGE-NPM]: https://img.shields.io/npm/v/@axaptional/electron-ipc.svg\r\n[BADGE-STANDARD]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\r\n[BADGE-COVERAGE]: https://raw.githubusercontent.com/axaptional/electron-ipc/v0.3.0/docs/images/coverage-badge-documentation.svg?sanitize=true\r\n\r\n<!-- Help -->\r\n[methods]: https://github.com/axaptional/electron-ipc/blob/v0.3.0/markdown/methods.md\r\n\r\n<!-- General references -->\r\n[electron-ipc-rx]: https://github.com/axaptional/electron-ipc-rx\r\n[bluebird]: https://github.com/petkaantonov/bluebird\r\n[any-promise]: https://github.com/kevinbeaty/any-promise\r\n","readmeFilename":"README.md","homepage":"https://github.com/axaptional/electron-ipc#readme","repository":{"type":"git","url":"git+https://github.com/axaptional/electron-ipc.git"},"bugs":{"url":"https://github.com/axaptional/electron-ipc/issues"}}