Compare commits

...

194 Commits
v6.x ... master

Author SHA1 Message Date
Brandon Nozaki Miller 088a1ca4d5
Update README.md 2022-03-18 01:46:25 -07:00
Brandon Nozaki Miller b78969d045
Added sponsor badge 2021-12-10 15:27:38 -08:00
Brandon Nozaki Miller 9bbd515473
clarifying v10+ includes 2021-12-08 08:32:38 -08:00
Brandon Nozaki Miller 6f265d9cb0
clarified es6 vs commonjs import 2021-12-07 09:58:18 -08:00
Brandon Nozaki Miller 7a614ce9be
Merge pull request #219 from tripodsgames/cjs
V10 cjs compatibility.
2021-09-15 11:18:48 -07:00
tripodsgames 083546305f
Fix ESM and Commonjs compatibility. 2021-09-15 11:06:48 -03:00
André Antônio Posso da Silva 98c6fc8140
Update README.md
Improvements to README.
2021-09-15 10:54:49 -03:00
Brandon Nozaki Miller 486c3138d2
updating version for cjs support 2021-09-15 06:38:43 -07:00
tripodsgames 144178f021
Fixed deprecated prepublish script. 2021-09-14 21:31:03 -03:00
tripodsgames dfc8554352
Update gitignore. 2021-09-14 21:29:17 -03:00
tripodsgames 86292a2bab
Update readme. 2021-09-14 21:27:45 -03:00
tripodsgames de80f537ef
Set target to cjs. 2021-09-14 21:26:08 -03:00
tripodsgames ad4a033888
Use esbuild to build commonjs code. 2021-09-14 21:20:10 -03:00
Brandon Nozaki Miller 624625693e
Merge pull request #210 from Mirdukkk/master
fix(readme): fix typo
2021-07-28 17:13:11 -07:00
Mirdukkk 09ca809512
fix(readme): fix typo 2021-07-14 16:03:42 +03:00
Brandon a5939c1a8a prepping for 10.0.2 patch 2021-07-07 13:16:21 -07:00
Brandon ec0969ee83 merge prep for 10.0.2 patch pub 2021-07-07 13:13:45 -07:00
Brandon Nozaki Miller 2bacbd72f2 patch rev for slight change to main file 2021-07-07 20:11:27 +00:00
Brandon Nozaki Miller f35940636e updated cluster docs 2021-07-07 20:10:40 +00:00
Brandon Nozaki Miller 64fef8b3a5 fixing docs 2021-07-07 19:59:31 +00:00
Brandon Nozaki Miller dd7335a2c6
do not use coverage dir to determine language 2021-07-04 12:00:13 -07:00
Brandon Nozaki Miller 73cc089d54 fixed test file capitolization for linux systems 2021-07-04 16:23:34 +00:00
Brandon Nozaki Miller f89a1812ef capitolization od UDP files 2021-07-04 16:22:28 +00:00
Brandon Nozaki Miller 0a9d04099a spelling break so git will detect capitolization 2021-07-04 16:21:50 +00:00
Brandon 778bdee973 reducing NPM package size by excluding more dirs 2021-07-04 00:24:11 -07:00
Brandon 5d0a1ba10a prep for major release 2021-07-04 00:18:44 -07:00
Brandon 99a8db8832 unix/posix/win socket testing complete 2021-07-04 00:12:00 -07:00
Brandon facbc027d9 fixing lcov badge path 2021-07-03 22:49:54 -07:00
Brandon aa7206daba tcp & udp4 & 6 tests complete 2021-07-03 22:44:09 -07:00
Brandon 7da90e18f9 Basic TCP tests complete 2021-07-02 18:37:53 -07:00
Brandon 3a843badb4 migrating to ESM v10 2021-07-02 15:01:41 -07:00
Brandon a2f4c61362 migrating to ESM merging v9.2.1 2021-07-02 14:58:06 -07:00
Brandon Nozaki Miller 8f2d054564 rev patch 2021-07-02 21:45:17 +00:00
Brandon d48b268c6e migrating to ESM merging v9.2.1 2021-07-02 14:39:07 -07:00
Brandon f3458e7a7b migrating to ESM 2021-07-02 14:35:02 -07:00
Brandon Nozaki Miller 84dce1b4b2
Merge pull request #205 from si458/patch-1
set pipe read/write in variables
2021-07-02 14:34:10 -07:00
Simon Smith 74c7886968 set pipe read/write ability to variables 2021-07-02 21:10:01 +01:00
Brandon Nozaki Miller 90b6a414a2
Update FUNDING.yml 2021-07-01 19:30:06 -07:00
Brandon 83ee8b559c fixes #188 rev v9.2.0 2021-07-01 16:30:09 -07:00
Brandon Nozaki Miller 1bb8a3911f
patch for #199 2021-07-01 16:03:35 -07:00
Brandon Nozaki Miller a45a86873a
Delete appveyor.yml 2021-07-01 16:02:30 -07:00
Brandon Nozaki Miller 40278b101d
Delete .travis.yml 2021-07-01 16:02:19 -07:00
Brandon Nozaki Miller 3fdbb35e53
Merge pull request #200 from si458/patch-1
allow all users to access the pipe
2021-07-01 16:01:21 -07:00
Brandon Nozaki Miller 4a513eebad
Merge branch 'master' into patch-1 2021-07-01 15:52:17 -07:00
Brandon Nozaki Miller ade907b0af
Merge pull request #195 from ulivz/patch-1
chore: fix wrong hash
2021-07-01 15:50:49 -07:00
Brandon Nozaki Miller 97676a93a8
Merge pull request #192 from aghArdeshir/patch-1
omit extra table row from README.md IPC Events
2021-07-01 15:48:51 -07:00
Brandon Nozaki Miller 81a5be69e0
Merge branch 'master' into patch-1 2021-07-01 15:47:53 -07:00
Brandon Nozaki Miller cb51bb286e
Merge branch 'master' into patch-1 2021-07-01 15:46:26 -07:00
Brandon Nozaki Miller e228d446d4
Delete node.js.yml 2021-07-01 15:45:33 -07:00
Brandon Nozaki Miller 9afc5a344f
node.js action CI integration 2021-07-01 15:44:40 -07:00
Brandon Nozaki Miller 62f9f56929
Create node.js.yml
action CI
2021-07-01 15:43:10 -07:00
Simon Smith f0c64a8282
allow all users to access the pipe 2021-06-30 14:39:52 +01:00
ULIVZ 87abf2df48
chore: fix wrong hash 2021-05-28 00:13:18 +08:00
aghArdeshir fa41cd0428
omit extra table row from README.md IPC Events 2021-04-04 12:11:51 +04:30
Brandon 50c0ec6735 version rev for @tenbits pr #189 2021-02-26 09:15:41 -08:00
Brandon Nozaki Miller a335ce43e6
Merge pull request #189 from tenbits/fix/ignore-retry-when-disconnected
fix (client retry) check if explicitly disconnected
2021-02-26 09:07:55 -08:00
Alex Kit f483e3153a fix (client retry) check if explicitly disconnected 2021-02-26 11:07:03 +01:00
Brandon Nozaki Miller c82afb34b5
Travis UDP6 not supported on linux, not even on loopback ::1 Super annoying. Will need to find a way to make this work or another CI 2021-02-23 23:19:05 -08:00
Brandon Nozaki Miller 2d1dbfddac
Travis is annoyingly unable to handle UDP6 sockets in linux newer than trusty. 2021-02-23 23:09:46 -08:00
Brandon Nozaki Miller 01cf29472b
trying to update to focal because xenial does not support ipv6 2021-02-23 23:05:48 -08:00
Brandon Nozaki Miller 2151caf3ee
fixing language generated syntax 2021-02-23 22:44:57 -08:00
Brandon 60b69dcd65 Merge branch 'master' of github.com:RIAEvangelist/node-ipc into master 2021-02-23 22:43:25 -08:00
Brandon 91f1f75c47 adding git attributes file to fix incorrect language of package 2021-02-23 22:43:06 -08:00
Brandon Nozaki Miller 7487c936fa
adding support for github funding.
It would be a super big help if I had even just a couple sponsors
2021-01-09 17:31:24 -08:00
Brandon Nozaki Miller bb32062841
Need to sign up for sponsorships before this works. 2021-01-09 13:19:08 -08:00
Brandon Nozaki Miller 33d9853f59
Update FUNDING.yml 2021-01-09 13:17:16 -08:00
Brandon Nozaki Miller 5023e6cb43
Create FUNDING.yml 2021-01-09 13:16:33 -08:00
Brandon Nozaki Miller 90504f25b6 removing notice of v10.x github only update 2020-11-12 11:03:07 -08:00
Brandon ce112b3457 reved patch num 2020-11-12 08:50:54 -08:00
Brandon 9a1ad86d17 updated licence.md to just licence, updated js-message version req to 1.0.7 for MIT lic also updated docs to remove DBAD refs 2020-11-12 08:50:20 -08:00
Brandon 5022bb23dc updating deps to support MIT 2020-11-11 13:17:33 -08:00
Brandon 26e298191c prepping to upgrade package 2020-11-11 12:50:16 -08:00
Brandon 30e426fd7b testing updates node 8-14 only 2020-11-11 12:46:57 -08:00
Brandon 768c5fc3a6 MIT Licence and Buffer fix 2020-11-11 12:21:02 -08:00
Brandon Nozaki Miller 3c95b0ef14
Update README.md
notification of update start
2019-12-04 10:54:58 -08:00
Brandon Nozaki Miller b90cf697c8
Merge pull request #166 from timbowhite/fix-165
fix #165
2019-12-02 00:57:37 -08:00
Brandon Nozaki Miller 7469dbac01
Merge branch 'master' into fix-165 2019-12-02 00:57:26 -08:00
Brandon Nozaki Miller 95d790a98a
Merge pull request #162 from luciopaiva/patch-1
Fix typo in documentation
2019-12-02 00:51:21 -08:00
Brandon Nozaki Miller bbdd094721
Merge pull request #153 from Slapbox/patch-1
Corrects very minor typo
2019-12-02 00:48:55 -08:00
Brandon Nozaki Miller b7e2476589
Merge branch 'master' into patch-1 2019-12-02 00:48:26 -08:00
Brandon Nozaki Miller 076053ead7
Merge pull request #132 from yoo2001818/master
Fix ipcBuffer being shared with all connected sockets
2019-12-02 00:44:22 -08:00
Timbo White 6b777493d2 fix #165 2019-11-11 14:51:27 +00:00
Lucio Paiva 8b30a7dd95
Fix typo 2019-07-04 19:18:04 +01:00
Slapbox 3ff6bd66a0
Corrects very minor typo
Changes 'top' to 'to'
2018-09-12 19:12:13 -04:00
Duknam Yoo 800936ab08
Fix ipcBuffer being shared with all sockets 2017-11-09 14:42:05 +09:00
Brandon Nozaki Miller 70e03c119b Merge pull request #130 from 0x5e/patch-1
Add documentation of `delimiter` variable
2017-10-26 13:02:52 -07:00
gaosen 2dca400678 Update README.md
Add documentation of `delimiter` variable
2017-10-25 21:05:22 +01:00
Brandon Nozaki Miller 17f7f111ff rev 2017-08-25 00:21:36 -07:00
Brandon Nozaki Miller a5bcf0d168 Merge pull request #126 from vale981/patch-1
Update event-pubsub
2017-08-25 00:19:04 -07:00
vale981 b7f94b8999 Update event-pubsub 2017-08-24 15:31:35 +02:00
Brandon Nozaki Miller 2193d6fae2 rev 2017-07-21 05:27:22 -07:00
Brandon Nozaki Miller 94249c24ea Merge pull request #116 from medicomp/master
Compatibility with Node.js cluster module
2017-07-21 05:23:11 -07:00
Brandon Miller 1d8fae31ec added example files to example/cluster/* tweaked readme style example 2017-07-21 05:18:16 -07:00
Luke Stratman e297474e1c Added documentation and examples to README 2017-07-14 18:09:35 -04:00
Brandon Nozaki Miller 366454648c Merge branch 'master' into master 2017-07-12 22:34:07 -07:00
Brandon Nozaki Miller 4cbb71253e windows only test node 6,7,and 8 2017-07-12 22:32:52 -07:00
Brandon Nozaki Miller 27672cfc00 only test 678 versions of node 2017-07-12 22:32:04 -07:00
Brandon Nozaki Miller eb486cc172 Merge branch 'master' into master 2017-07-12 16:30:32 -07:00
Brandon Nozaki Miller 22bc09ad54 Merge pull request #121 from benblank/logger
Allow users to specify a custom logger
2017-07-12 16:28:59 -07:00
Ben Blank c62e699844 add support for a configurable logger 2017-06-25 19:44:48 -07:00
Luke Stratman 8463175f62 Fixed a syntax error 2017-05-24 13:38:42 -04:00
Luke Stratman 1df857ce3a Cluster module support
Added an option to control whether or not node-ipc unlinks the Unix
socket path when it starts a server which, when set to false, allows the
overall application to handle this and allows node-ipc to work with the
Node.js cluster module.
2017-05-24 13:36:40 -04:00
Brandon Nozaki Miller 22c5688737 Merge pull request #115 from atiertant/patch-1
fix this.log is not a function
2017-05-18 15:21:36 -07:00
Brandon Nozaki Miller fdfd13b98f binding this is better for garbage collection. 2017-05-18 14:22:56 -07:00
Alexandre Tiertant f6bd9e7832 fix this.log is not a function 2017-05-05 14:30:22 +02:00
RIAEvangelist 6e9a012cb3 fixed poor require practice 2017-04-15 22:59:29 -07:00
RIAEvangelist c18baa2ae3 rev 2017-04-15 22:18:33 -07:00
RIAEvangelist 8886f82faa cleanup, performance improvements and reformatting 2017-04-15 22:17:25 -07:00
RIAEvangelist e4098d1921 Merge branch 'master' of github.com:RIAEvangelist/node-ipc 2017-04-15 21:13:25 -07:00
RIAEvangelist a5bf16503c es6 updates 2017-04-15 21:13:15 -07:00
Brandon Nozaki Miller 52c37718c3 Merge pull request #113 from MaxXx1313/master
fix issue #112
2017-04-04 18:52:51 -07:00
Maksim Chartkou 33f717006b fix: this.log is not a function 2017-03-27 16:10:13 +03:00
RIAEvangelist e79e8064f4 Merge branch 'master' of github.com:RIAEvangelist/node-ipc 2017-02-14 04:02:07 -08:00
RIAEvangelist 729149d095 test passed 2017-02-14 04:01:52 -08:00
Brandon Nozaki Miller 2eb369dba3 Merge pull request #111 from RIAEvangelist/v8.x
v8.10.3
2017-02-14 03:55:11 -08:00
RIAEvangelist 0690914634 v8.10.2 2017-02-14 03:32:49 -08:00
Brandon Nozaki Miller fad4cbb683 Merge pull request #103 from wearetrail/master
Ensure message format availability
2017-02-14 03:10:43 -08:00
Brandon Nozaki Miller e865e949ce test may run too fast sometimes 2017-02-13 23:27:11 -08:00
Brandon Nozaki Miller 524a63e88f spec path updates required 2017-02-13 23:16:33 -08:00
Brandon Nozaki Miller 4edd1d044e do not reject messages
allow loose message sending, but prevent handling errors
2017-02-13 22:37:24 -08:00
Melvin Valster 4f9f206b42 Check for type and data not being undefined 2017-01-24 11:22:53 +01:00
Melvin cfcf815275 Merge branch 'master' into master 2017-01-24 11:11:39 +01:00
RIAEvangelist b3bbeece24 moved node-cmd to devDeps 2016-12-22 11:44:15 -08:00
RIAEvangelist 9d9dd746c2 dep updates 2016-12-22 11:38:45 -08:00
RIAEvangelist eda84a4093 fix for windows posix sockets 2016-12-21 19:34:53 -08:00
RIAEvangelist c899df2f42 confirmed network interface release 2016-12-21 19:15:47 -08:00
RIAEvangelist 872e3ff090 Default simplification and interface addition 2016-12-21 17:03:12 -08:00
Melvin 3ca19e205e Merge branch 'master' into master 2016-12-21 11:51:40 +01:00
RIAEvangelist 0218c8340f CI config updates 2016-12-20 18:28:51 -08:00
Brandon Nozaki Miller 855e1a371f Update package.json
rev
2016-12-19 17:08:44 -08:00
Brandon Nozaki Miller 4c764fd310 Merge pull request #106 from kevinwilson541/fix/tls-server-connect
call startTLSServer in socketServer to init this.server
2016-12-19 17:07:41 -08:00
Kevin Wilson c849889590 call startTLSServer in socketServer to init this.server 2016-12-03 01:31:03 -08:00
Melvin 8de357f488 Ensure message format availability
Make sure the entire process doesn't crash when a message is sent without `type` and/or `data` as such:

```
error: Uncaught Exception TypeError: Cannot read property 'id' of undefined
    at Server.gotData (/usr/src/app/node_modules/@trail/pigeoneer/node_modules/node-ipc/dao/socketServer.js:181:24)
    at emitOne (events.js:101:20)
    at Socket.emit (events.js:188:7)
    at Socket.EventEmitter.emit (/usr/src/app/node_modules/@trail/pigeoneer/node_modules/sc-domain/index.js:12:31)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:548:20)
```
2016-11-15 15:17:54 +01:00
Brandon Nozaki Miller e7739111fc Merge pull request #102 from RIAEvangelist/v8.x
V8.9.2
2016-10-06 16:35:10 -07:00
SSMP 78d6703b2a upping event-pubsub 2016-10-06 15:53:17 -07:00
Brandon Nozaki Miller 2deb238fd7 Merge pull request #98 from RIAEvangelist/master
merge ci testing
2016-10-06 02:08:03 -07:00
SSMP a01f0bc824 rev for CI testing on mac/linux/windows 2016-10-06 01:30:54 -07:00
SSMP cb5c9ce222 testing mac and linux 2016-10-06 01:24:44 -07:00
SSMP e936bf27e7 adding travis build 2016-10-06 01:20:47 -07:00
SSMP 2909fa216e testing TRAVIS_BUILD_NUMBER 2016-10-06 01:10:54 -07:00
SSMP fb1f737b05 testing travis 2016-10-06 00:57:05 -07:00
SSMP ce035c0d98 fleshing out windows builds 2016-10-06 00:27:21 -07:00
SSMP 1cf1084241 official support revved to node v4+ 2016-10-05 23:48:44 -07:00
SSMP 9731401fdc rev io for windows testing without --harmony 2016-10-05 23:45:37 -07:00
SSMP 73efdb3f38 rev io.js ci tests for windows 2016-10-05 23:43:41 -07:00
SSMP 429c73f12c removing support for 0.12 2016-10-05 23:38:59 -07:00
SSMP 5424258154 changing unix/windows socket spec to have greater delay for windows builds 2016-10-05 23:36:07 -07:00
SSMP c30789b779 explicit event-pubsub 4.2.2 2016-10-05 23:30:28 -07:00
SSMP cdeab7826c windows ci testing ugk :( 2016-10-05 23:16:14 -07:00
SSMP fdfb805440 using windows command for appveyor 2016-10-05 23:14:44 -07:00
SSMP 8cbfe37e40 removing bad appveyor command 2016-10-05 23:03:39 -07:00
SSMP 9b0ee933d2 testing appveyor for windows integration tests 2016-10-05 23:01:54 -07:00
SSMP 4b5f95a337 node version detection 2016-10-03 13:34:27 -07:00
SSMP 84b11cccfb coverage with new event pubsub 2016-09-30 06:12:20 -07:00
SSMP 825e16fcba Merge branch 'master' of github.com:RIAEvangelist/node-ipc 2016-09-30 06:11:01 -07:00
SSMP 49b631b270 new event pubsub support 2016-09-30 06:00:28 -07:00
Brandon Nozaki Miller bad93ae7c4 Merge pull request #85 from Stealthmate/add_socketdisconnect_to_doc
Add 'socket.disconnected' to documentation
2016-09-13 23:18:29 -07:00
Stealthmate 8b712f4da8 fixed formatting 2016-09-13 20:36:11 +03:00
Stealthmate fbed93b8d9 added socket.disconnected to docs 2016-09-13 20:34:44 +03:00
Stealthmate ae5cf39375 Revert "Revert "evert "Added 'socket.disconnect' to event list in docs"""
This reverts commit 11f262418d.
2016-09-13 20:30:17 +03:00
Stealthmate 1d76173865 Revert "evert "Added 'socket.disconnect' to event list in docs""
This reverts commit c3ec2f1c86.
2016-09-13 20:30:15 +03:00
Stealthmate 19329fb8bd Revert "wat"
This reverts commit 2f5cfe1f0a.
2016-09-13 20:30:11 +03:00
Stealthmate 576114ee83 Revert "wrong branch"
This reverts commit dcde4b69fb.
2016-09-13 20:30:07 +03:00
Stealthmate 234a3fa16e Revert "Added 'socket.disconnect' to event list in docs"
This reverts commit c4578386ed.
2016-09-13 20:30:01 +03:00
Stealthmate 11f262418d Revert "evert "Added 'socket.disconnect' to event list in docs""
This reverts commit c3ec2f1c86.
2016-09-13 20:27:56 +03:00
Stealthmate c3ec2f1c86 evert "Added 'socket.disconnect' to event list in docs"
sTihis reverts commit c4578386ed.
2016-09-13 20:26:46 +03:00
Stealthmate 2f5cfe1f0a wat 2016-09-13 20:26:24 +03:00
Stealthmate dcde4b69fb wrong branch 2016-09-13 20:17:38 +03:00
Stealthmate c4578386ed Added 'socket.disconnect' to event list in docs
- Also added a listener in the Basic Examples
2016-09-13 20:10:21 +03:00
SSMP 6c01ffc0b7 updated example certs 2016-09-10 15:09:44 -07:00
SSMP 028e597a9b fixes #83 2016-08-12 15:25:49 -07:00
Brandon Nozaki Miller df8c3c0d90 Update disconnect event removal 2016-08-12 14:07:03 -07:00
Brandon Nozaki Miller 5eb7eb1894 Update package.json 2016-08-02 12:34:02 -07:00
Brandon Nozaki Miller 56dfe7f0ea Merge pull request #82 from mrvini/master
updates to defaults entities, making sure that node-ipc could be run …
2016-08-02 12:14:56 -07:00
Val Vinder 0d16860a45 updates to defaults entities, making sure that node-ipc could be run even if no network interfaces are present 2016-08-02 12:04:28 -07:00
Brandon Nozaki Miller 5824ae9b32 rev 2016-07-14 16:09:32 -07:00
Brandon Nozaki Miller adb651d708 testing 2016-07-14 16:05:02 -07:00
Brandon Nozaki Miller bec3950022 Merge pull request #72 from Mostafa-Samir/win/fixes
Fixing retry logic and UDP4 default host
2016-07-14 16:03:22 -07:00
Brandon Nozaki Miller c2bffb5451 Merge pull request #73 from Mostafa-Samir/disconnect/fix
Using a client-specific flag to disconnect instead of using config.stopRetrying
2016-07-14 16:02:33 -07:00
Brandon Nozaki Miller d28e5498b0 Merge pull request #81 from alansikora/master
Make sure production environments does not break due to event-pubsub updates
2016-07-14 15:44:55 -07:00
Alan Sikora c1f4755ad6 Make sure production environments does not break due to event-pubsub updates 2016-07-14 13:16:32 -03:00
Brandon Nozaki Miller 0c5156cf15 Merge pull request #70 from mwshortt/fix-received-spelling
Fix typo in client log: recieved -> received
2016-04-26 17:06:05 -07:00
Mostafa Samir f3f7bdbf3f set client's 'explicitlyDisconnected' flag to true when disconnect is called
this is instead of using the 'stopRetrying' flag that would affect the retrying policy of other clients
2016-04-04 00:32:17 +02:00
Mostafa Samir 90260d1d3d added 'explicitlyDisconnected' flag to Client object
this flag will be set to true when a 'ipc.disconnect' is called on the client to prevent the client from attempting to retry to connect
2016-04-04 00:30:44 +02:00
Mostafa Samir ec45f36ae0 updated comment by removing mention of windows
any syetem that has it first network interface on ipv6 will also fail if udp4 was bound on it, not just windows
2016-04-01 22:06:00 +02:00
Mostafa Samir 36457fa5bd made udp4 socket default bind to an ipv4 address
it seems that on windows, binding a udp4 socket to an ipv6 address (here is ::1) raises and EINVAL error
2016-04-01 21:28:39 +02:00
Mostafa Samir e9d34a8178 auto-updated coverage reports 2016-04-01 20:32:18 +02:00
Mostafa Samir 387fa3b0ea tweaked the test suite to accommodate to windows delays 2016-04-01 20:29:42 +02:00
Mostafa Samir d3181ddafe removed seemingly unnecessary resetRetriesCheck function
the function being set to fire after 100ms conflicted with delays in firing the 'disconnect' event on windows, and this resulted in the socket's 'retriesRemianing' being reset after every decrement and thus violatin the 'maxRetries' rule
2016-04-01 20:26:26 +02:00
Mostafa Samir b60152d0b3 auto-updated coverage reports 2016-04-01 19:50:28 +02:00
Mostafa Samir d2aaa7eb0e ignored npm-debug.log files 2016-04-01 19:49:17 +02:00
Mostafa Samir 3ee9c94818 added a script to run tests on windows
created a sepearte script to avoid any potential problems that could occur if original scripts were changed
2016-04-01 19:45:11 +02:00
Madeline Shortt 60be1a3a2e Fix typo in client log: recieved -> received 2016-03-28 17:45:36 -07:00
Brandon Nozaki Miller df0c6407c1 major revisions to binary, hex and other rawBuffer sockets 2016-03-23 00:07:37 -07:00
159 changed files with 14389 additions and 8938 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
coverage/**/* linguist-generated=true

4
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,4 @@
# These are supported funding model platforms
github: RIAEvangelist

33
.github/workflows/node.js.yml vendored Normal file
View File

@ -0,0 +1,33 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
node_version:
- 14.x
- 16.x
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
/nbproject/private/
/node_modules/
/nbproject
npm-debug.log
node-ipc.cjs

4
.npmignore Normal file
View File

@ -0,0 +1,4 @@
spec
example
coverage
test

306
README.md
View File

@ -1,31 +1,58 @@
Thanks for all the free pizza, and thanks to all the police that showed up to SWAT me. They were really nice fellas.
node-ipc
================
[![Sponsor RIAEvangelist to help development of node-ipc](https://img.shields.io/static/v1?label=Sponsor%20Me%20On%20Github&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/RIAEvangelist)](https://github.com/sponsors/RIAEvangelist)
*a nodejs module for local and remote Inter Process Communication* with full support for Linux, Mac and Windows. It also supports all forms of socket communication from low level unix and windows sockets to UDP and secure TLS and TCP sockets.
A great solution for complex multiprocess **Neural Networking** in Node.JS
**npm install node-ipc**
`npm install node-ipc`
#### for node <v14
`npm install node-ipc@^9.0.0`
#### including v10 or greater into your code
```js
//es6
import ipc from 'node-ipc'
//commonjs
const ipc = require('node-ipc').default;
```
#### NPM Stats
npm info : [See npm trends and stats for node-ipc](http://npm-stat.com/charts.html?package=node-ipc&author=&from=&to=)
[![NPM](https://nodei.co/npm/node-ipc.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/node-ipc/)
[![Package Quality](http://npm.packagequality.com/badge/node-ipc.png)](http://packagequality.com/#?package=node-ipc)
![node-ipc npm version](https://img.shields.io/npm/v/node-ipc.svg) ![supported node version for node-ipc](https://img.shields.io/node/v/node-ipc.svg) ![total npm downloads for node-ipc](https://img.shields.io/npm/dt/node-ipc.svg) ![monthly npm downloads for node-ipc](https://img.shields.io/npm/dm/node-ipc.svg) ![npm licence for node-ipc](https://img.shields.io/npm/l/node-ipc.svg)
[![RIAEvangelist](https://avatars3.githubusercontent.com/u/369041?v=3&s=100)](https://github.com/RIAEvangelist)
![node-ipc npm version](https://img.shields.io/npm/v/node-ipc.svg) ![supported node version for node-ipc](https://img.shields.io/node/v/node-ipc.svg) ![total npm downloads for node-ipc](https://img.shields.io/npm/dt/node-ipc.svg) ![monthly npm downloads for node-ipc](https://img.shields.io/npm/dm/node-ipc.svg) ![npm licence for node-ipc](https://img.shields.io/npm/l/node-ipc.svg)
GitHub info :
![node-ipc GitHub Release](https://img.shields.io/github/release/RIAEvangelist/node-ipc.svg) ![GitHub license node-ipc license](https://img.shields.io/github/license/RIAEvangelist/node-ipc.svg) ![open issues for node-ipc on GitHub](https://img.shields.io/github/issues/RIAEvangelist/node-ipc.svg)
Codacy info :
[![Codacy Badge](https://api.codacy.com/project/badge/grade/8e0294dff55f4ac1985c07b16f39d0a9)](https://www.codacy.com/app/RIAEvangelist/node-ipc) [![Codacy Badge](https://api.codacy.com/project/badge/coverage/8e0294dff55f4ac1985c07b16f39d0a9)](https://www.codacy.com/app/RIAEvangelist/node-ipc)
Code Coverage Info :
![lcov node-ipc](/coverage/lcov.svg)
Run `npm run coverage` to host a local version of the coverage report on [localhost:8080](http://localhost:8080) This is the same format as Istanbul and NYC. It should be very familiar.
Testing done with [vanilla-test](https://github.com/RIAEvangelist/vanilla-test)
`vanilla-test` integrates with [c8](https://github.com/bcoe/c8) for native ESM coverage without the need to transpile your code. At the time of writing, this is the only way to natively test ESM, and it is amazing!
Package details websites :
* [GitHub.io site](http://riaevangelist.github.io/node-ipc/ "node-ipc documentation"). A prettier version of this site.
* [NPM Module](https://www.npmjs.org/package/node-ipc "node-ipc npm module"). The npm page for the node-ipc module.
This work is licenced via the [DBAD Public Licence](http://www.dbad-license.org/).
This work is licenced via the MIT Licence.
#### Older versions of node
the latest versions of `node-ipc` may work with the --harmony flag. Officially though, we support node v4 and newer with es5 and es6
#### Testing
@ -37,6 +64,7 @@ You may want to install jasmine and istanbul globally with ` sudo npm install -g
#### Contents
1. [Types of IPC Sockets and Supporting OS](#types-of-ipc-sockets)
1. [IPC Config](#ipc-config)
2. [IPC Methods](#ipc-methods)
1. [log](#log)
2. [connectTo](#connectto)
@ -46,13 +74,14 @@ You may want to install jasmine and istanbul globally with ` sudo npm install -g
6. [serveNet](#servenet)
3. [IPC Stores and Default Variables](#ipc-stores-and-default-variables)
4. [IPC Events](#ipc-events)
5. [Basic Examples](#basic-examples)
1. [Server for Unix||Windows Sockets & TCP Sockets](#server-for-unix-sockets--tcp-sockets)
5. [Multiple IPC instances](#multiple-ipc-instances)
6. [Basic Examples](#basic-examples)
1. [Server for Unix||Windows Sockets & TCP Sockets](#server-for-unix-sockets-windows-sockets--tcp-sockets)
2. [Client for Unix||Windows Sockets & TCP Sockets](#client-for-unix-sockets--tcp-sockets)
4. [Server & Client for UDP Sockets](#server--client-for-udp-sockets)
5. [Raw Buffers or Binary Sockets](#raw-buffer-or-binary-sockets)
6. [Working with TLS/SSL Socket Servers & Clients](https://github.com/RIAEvangelist/node-ipc/tree/master/example/TLSSocket)
7. [Advanced Examples](https://github.com/RIAEvangelist/node-ipc/tree/master/example)
5. [Raw Buffers, Real Time and / or Binary Sockets](#raw-buffer-or-binary-sockets)
7. [Working with TLS/SSL Socket Servers & Clients](https://github.com/RIAEvangelist/node-ipc/tree/master/example/TLSSocket)
8. [Node Code Examples](https://github.com/RIAEvangelist/node-ipc/tree/master/example)
----
@ -73,6 +102,8 @@ You may want to install jasmine and istanbul globally with ` sudo npm install -g
----
#### IPC Config
`ipc.config`
Set these variables in the `ipc.config` scope to overwrite or set default values.
@ -85,33 +116,55 @@ Set these variables in the `ipc.config` scope to overwrite or set default values
id : os.hostname(),
networkHost : 'localhost', //should resolve to 127.0.0.1 or ::1 see the table below related to this
networkPort : 8000,
readableAll : false,
writableAll : false,
encoding : 'utf8',
rawBuffer : false,
delimiter : '\f',
sync : false,
silent : false,
logInColor : true,
logDepth : 5,
logger : console.log,
maxConnections : 100,
retry : 500,
maxRetries : false,
stopRetrying : false
stopRetrying : false,
unlink : true,
interfaces : {
localAddress: false,
localPort : false,
family : false,
hints : false,
lookup : false
}
}
```
| variable | documentation |
|----------|---------------|
| appspace | used for Unix Socket (Unix Domain Socket) namespacing. If not set specifically, the Unix Domain Socket will combine the socketRoot, appspace, and id to form the Unix Socket Path for creation or binding. This is available incase you have many apps running on your system, you may have several sockets with the same id, but if you change the appspace, you will still have app specic unique sockets.|
| appspace | used for Unix Socket (Unix Domain Socket) namespacing. If not set specifically, the Unix Domain Socket will combine the socketRoot, appspace, and id to form the Unix Socket Path for creation or binding. This is available in case you have many apps running on your system, you may have several sockets with the same id, but if you change the appspace, you will still have app specic unique sockets.|
| socketRoot| the directory in which to create or bind to a Unix Socket |
| id | the id of this socket or service |
| networkHost| the local or remote host on which TCP, TLS or UDP Sockets should connect |
| networkPort| the default port on which TCP, TLS, or UDP sockets should connect |
| encoding | the default encoding for data sent on sockets. Mostly used if rawBuffer is set to true. Valid values are : ` ascii` ` utf8 ` ` utf16le` ` ucs2` ` base64` ` hex ` .
| readableAll| makes the pipe readable for all users including windows services |
| writableAll| makes the pipe writable for all users including windows services |
| encoding | the default encoding for data sent on sockets. Mostly used if rawBuffer is set to true. Valid values are : ` ascii` ` utf8 ` ` utf16le` ` ucs2` ` base64` ` hex ` . |
| rawBuffer| if true, data will be sent and received as a raw node ` Buffer ` __NOT__ an ` Object ` as JSON. This is great for Binary or hex IPC, and communicating with other processes in languages like C and C++ |
| delimiter| the delimiter at the end of each data packet. |
| sync | synchronous requests. Clients will not send new requests until the server answers. |
| silent | turn on/off logging default is false which means logging is on |
| logInColor | turn on/off util.inspect colors for ipc.log |
| logDepth | set the depth for util.inspect during ipc.log |
| logger | the function which receives the output from ipc.log; should take a single string argument |
| maxConnections| this is the max number of connections allowed to a socket. It is currently only being set on Unix Sockets. Other Socket types are using the system defaults. |
| retry | this is the time in milliseconds a client will wait before trying to reconnect to a server if the connection is lost. This does not effect UDP sockets since they do not have a client server relationship like Unix Sockets and TCP Sockets. |
| maxRetries | if set, it represents the maximum number of retries after each disconnect before giving up and completely killing a specific connection |
| stopRetrying| Defaults to false meaning clients will continue to retry to connect to servers indefinitely at the retry interval. If set to any number the client will stop retrying when that number is exceeded after each disconnect. If set to true in real time it will immediately stop trying to connect regardless of maxRetries. If set to 0, the client will ***NOT*** try to reconnect. |
| unlink| Defaults to true meaning that the module will take care of deleting the IPC socket prior to startup. If you use `node-ipc` in a clustered environment where there will be multiple listeners on the same socket, you must set this to `false` and then take care of deleting the socket in your own code. |
| interfaces| primarily used when specifying which interface a client should connect through. see the [socket.connect documentation in the node.js api](https://nodejs.org/api/net.html#net_socket_connect_options_connectlistener) |
----
@ -123,37 +176,15 @@ These methods are available in the IPC Scope.
`ipc.log(a,b,c,d,e...);`
ipc.log will accept any number of arguments and if `ipc.config.silent` is not set, it will concat them all with a sincle space ' ' between them and then log them to the console. This is fast because it prevents any concatenation from happening if the ipc is set to silent. That way if you leave your logging in place it should not effect performance.
ipc.log will accept any number of arguments and if `ipc.config.silent` is not set, it will concat them all with a single space ' ' between them and then log them to the console. This is fast because it prevents any concatenation from happening if the ipc.config.silent is set ` true `. That way if you leave your logging in place it should have almost no effect on performance.
The log also supports [colors](https://github.com/Marak/colors.js) implementation. All of the available styles are supported and the theme styles are as follows :
The log also uses util.inspect You can control if it should log in color, the log depth, and the destination via ` ipc.config `
```javascript
{
good : 'green',
notice : 'yellow',
warn : 'red',
error : 'redBG',
debug : 'magenta',
variable: 'cyan',
data : 'blue'
}
```
You can override any of these settings by requireing colors and setting the theme as follows :
```javascript
var colors=require('colors');
colors.setTheme(
{
good : 'zebra',
notice : 'redBG',
...
}
);
ipc.config.logInColor=true; //default
ipc.config.logDepth=5; //default
ipc.config.logger=console.log.bind(console); // default
```
@ -457,7 +488,7 @@ or specifying everything UDP
| method | definition |
|-----------|------------|
|start| start serving need top call ` serve ` or ` serveNet ` first to set up the server |
|start| start serving need to call ` serve ` or ` serveNet ` first to set up the server |
|stop| close the server and stop serving |
----
@ -468,11 +499,44 @@ or specifying everything UDP
|----------|------|----------|
|error|err obj|triggered when an error has occured|
|connect||triggered when socket connected|
|disconnect||triggered when socket disconnected|
|disconnect||triggered by client when socket has disconnected from server|
|socket.disconnected|socket destroyedSocketID|triggered by server when a client socket has disconnected|
|destroy||triggered when socket has been totally destroyed, no further auto retries will happen and all references are gone.|
|data|buffer|triggered when ipc.config.rawBuffer is true and a message is received.|
|***your event type***|***your event data***|triggered when a JSON message is received. The event name will be the type string from your message and the param will be the data object from your message eg : ` { type:'myEvent',data:{a:1}} ` |
||||
### Multiple IPC Instances
Sometimes you might need explicit and independent instances of node-ipc. Just for such scenarios we have exposed the core IPC class on the IPC singleton.
```javascript
import {IPCModule} from 'node-ipc';
const ipc=new RawIPC;
const someOtherExplicitIPC=new RawIPC;
//OR
const ipc=from 'node-ipc');
const someOtherExplicitIPC=new ipc.IPC;
//setting explicit configs
//keep one silent and the other verbose
ipc.config.silent=true;
someOtherExplicitIPC.config.silent=true;
//make one a raw binary and the other json based ipc
ipc.config.rawBuffer=false;
someOtherExplicitIPC.config.rawBuffer=true;
someOtherExplicitIPC.config.encoding='hex';
```
----
### Basic Examples
@ -483,7 +547,7 @@ The server is the process keeping a socket for IPC open. Multiple sockets can co
```javascript
var ipc=require('node-ipc');
import ipc from 'node-ipc';
ipc.config.id = 'world';
ipc.config.retry= 1500;
@ -502,6 +566,12 @@ The server is the process keeping a socket for IPC open. Multiple sockets can co
);
}
);
ipc.server.on(
'socket.disconnected',
function(socket, destroyedSocketID) {
ipc.log('client ' + destroyedSocketID + ' has disconnected!');
}
);
}
);
@ -514,7 +584,7 @@ The client connects to the servers socket for Inter Process Communication. The s
```javascript
var ipc=require('node-ipc');
import ipc from 'node-ipc';
ipc.config.id = 'hello';
ipc.config.retry= 1500;
@ -560,7 +630,7 @@ This is the most basic example which will work for both local and remote UDP Soc
```javascript
var ipc=require('../../../node-ipc');
import ipc from 'node-ipc';
ipc.config.id = 'world';
ipc.config.retry= 1500;
@ -630,7 +700,7 @@ This is the most basic example which will work for both local and remote UDP Soc
```
#### Raw Buffer or Binary Sockets
Binary or Buffer sockets can be used with any of the above socket types, however the way data events are emit is ***slightly*** different.
Binary or Buffer sockets can be used with any of the above socket types, however the way data events are emit is ***slightly*** different. These may come in handy if working with embedded systems or C / C++ processes. You can even make sure to match C or C++ string typing.
When setting up a rawBuffer socket you must specify it as such :
@ -669,6 +739,9 @@ emit byte array buffer :
```javascript
//hex encoding may work best for this.
ipc.config.encoding='hex';
//server
ipc.server.emit(
socket,
@ -682,10 +755,12 @@ emit byte array buffer :
```
emit hex array buffer :
emit binary or hex array buffer, this is best for real time data transfer, especially whan connecting to C or C++ processes, or embedded systems :
```javascript
ipc.config.encoding='hex';
//server
ipc.server.emit(
socket,
@ -699,5 +774,132 @@ emit hex array buffer :
```
#### Licensed under DBAD license
See the [DBAD license](https://github.com/philsturgeon/dbad) in your language or our [licence.md](https://github.com/RIAEvangelist/node-phidget-API/blob/master/license.md) file.
Writing explicit buffers, int types, doubles, floats etc. as well as big endian and little endian data to raw buffer nostly valuable when connecting to C or C++ processes, or embedded systems (see more detailed info on buffers as well as UInt, Int, double etc. here)[https://nodejs.org/api/buffer.html]:
```javascript
ipc.config.encoding='hex';
//make a 6 byte buffer for example
const myBuffer=Buffer.alloc(6).fill(0);
//fill the first 2 bytes with a 16 bit (2 byte) short unsigned int
//write a UInt16 (2 byte or short) as Big Endian
myBuffer.writeUInt16BE(
2, //value to write
0 //offset in bytes
);
//OR
myBuffer.writeUInt16LE(0x2,0);
//OR
myBuffer.writeUInt16LE(0x02,0);
//fill the remaining 4 bytes with a 32 bit (4 byte) long unsigned int
//write a UInt32 (4 byte or long) as Big Endian
myBuffer.writeUInt32BE(
16772812, //value to write
2 //offset in bytes
);
//OR
myBuffer.writeUInt32BE(0xffeecc,0)
//server
ipc.server.emit(
socket,
myBuffer
);
//client
ipc.server.emit(
myBuffer
);
```
#### Server with the `cluster` Module
`node-ipc` can be used with Node.js' [cluster module](https://nodejs.org/api/cluster.html) to provide the ability to have multiple readers for a single socket. Doing so simply requires you to set the `unlink` property in the config to `false` and take care of unlinking the socket path in the master process:
##### Server
```javascript
import fs from 'fs';
import ipc from 'node-ipc';
import {cpus} from 'os';
import cluster from 'cluster';
const cpuCount=cpus().length;
const socketPath='/tmp/ipc.sock';
ipc.config.unlink = false;
if (cluster.isMaster) {
if (fs.existsSync(socketPath)) {
fs.unlinkSync(socketPath);
}
for (let i = 0; i < cpuCount; i++) {
cluster.fork();
}
}else{
ipc.serve(
socketPath,
function() {
ipc.server.on(
'currentDate',
function(data,socket) {
console.log(`pid ${process.pid} got: `, data);
}
);
}
);
ipc.server.start();
console.log(`pid ${process.pid} listening on ${socketPath}`);
}
```
##### Client
```javascript
import fs from 'fs';
import ipc from 'node-ipc';
const socketPath = '/tmp/ipc.sock';
//loop forever so you can see the pid of the cluster sever change in the logs
setInterval(
function() {
ipc.connectTo(
'world',
socketPath,
connecting
);
},
2000
);
function connecting(socket) {
ipc.of.world.on(
'connect',
function() {
ipc.of.world.emit(
'currentDate',
{
message: new Date().toISOString()
}
);
ipc.disconnect('world');
}
);
}
```
#### Licensed under MIT license
See the [MIT license](https://github.com/RIAEvangelist/node-ipc/blob/master/license) file.

View File

@ -7,7 +7,7 @@ body {
font-size: 14px;
color:#333;
}
.small { font-size: 12px;; }
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
@ -152,9 +152,15 @@ table.coverage td span.cline-any {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
@ -166,19 +172,25 @@ table.coverage td span.cline-any {
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
.medium .chart { border:1px solid #666; }
.medium .cover-fill { background: #666; }
.cbranch-no { background: yellow !important; color: #111; }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.medium { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;

79
coverage/block-navigation.js generated Normal file
View File

@ -0,0 +1,79 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selecter that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);

BIN
coverage/favicon.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

171
coverage/index.html generated Normal file
View File

@ -0,0 +1,171 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">79.52% </span>
<span class="quiet">Statements</span>
<span class='fraction'>893/1123</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">68.1% </span>
<span class="quiet">Branches</span>
<span class='fraction'>111/163</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">84.91% </span>
<span class="quiet">Functions</span>
<span class='fraction'>45/53</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">79.52% </span>
<span class="quiet">Lines</span>
<span class='fraction'>893/1123</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="node-ipc"><a href="node-ipc/index.html">node-ipc</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
</tr>
<tr>
<td class="file medium" data-value="node-ipc/dao"><a href="node-ipc/dao/index.html">node-ipc/dao</a></td>
<td data-value="79.15" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
</td>
<td data-value="79.15" class="pct medium">79.15%</td>
<td data-value="657" class="abs medium">520/657</td>
<td data-value="67.03" class="pct medium">67.03%</td>
<td data-value="91" class="abs medium">61/91</td>
<td data-value="95.65" class="pct high">95.65%</td>
<td data-value="23" class="abs high">22/23</td>
<td data-value="79.15" class="pct medium">79.15%</td>
<td data-value="657" class="abs medium">520/657</td>
</tr>
<tr>
<td class="file high" data-value="node-ipc/entities"><a href="node-ipc/entities/index.html">node-ipc/entities</a></td>
<td data-value="93" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 93%"></div><div class="cover-empty" style="width: 7%"></div></div>
</td>
<td data-value="93" class="pct high">93%</td>
<td data-value="100" class="abs high">93/100</td>
<td data-value="75" class="pct medium">75%</td>
<td data-value="16" class="abs medium">12/16</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="93" class="pct high">93%</td>
<td data-value="100" class="abs high">93/100</td>
</tr>
<tr>
<td class="file high" data-value="node-ipc/helpers"><a href="node-ipc/helpers/index.html">node-ipc/helpers</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
</tr>
<tr>
<td class="file medium" data-value="node-ipc/services"><a href="node-ipc/services/index.html">node-ipc/services</a></td>
<td data-value="74.48" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
<td data-value="64" class="pct medium">64%</td>
<td data-value="50" class="abs medium">32/50</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="21" class="abs medium">14/21</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

224
coverage/lcov-report/base.css generated Normal file
View File

@ -0,0 +1,224 @@
body, html {
margin:0; padding: 0;
height: 100%;
}
body {
font-family: Helvetica Neue, Helvetica, Arial;
font-size: 14px;
color:#333;
}
.small { font-size: 12px; }
*, *:after, *:before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
h1 { font-size: 20px; margin: 0;}
h2 { font-size: 14px; }
pre {
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
margin: 0;
padding: 0;
-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;
}
a { color:#0074D9; text-decoration:none; }
a:hover { text-decoration:underline; }
.strong { font-weight: bold; }
.space-top1 { padding: 10px 0 0 0; }
.pad2y { padding: 20px 0; }
.pad1y { padding: 10px 0; }
.pad2x { padding: 0 20px; }
.pad2 { padding: 20px; }
.pad1 { padding: 10px; }
.space-left2 { padding-left:55px; }
.space-right2 { padding-right:20px; }
.center { text-align:center; }
.clearfix { display:block; }
.clearfix:after {
content:'';
display:block;
height:0;
clear:both;
visibility:hidden;
}
.fl { float: left; }
@media only screen and (max-width:640px) {
.col3 { width:100%; max-width:100%; }
.hide-mobile { display:none!important; }
}
.quiet {
color: #7f7f7f;
color: rgba(0,0,0,0.5);
}
.quiet a { opacity: 0.7; }
.fraction {
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 10px;
color: #555;
background: #E8E8E8;
padding: 4px 5px;
border-radius: 3px;
vertical-align: middle;
}
div.path a:link, div.path a:visited { color: #333; }
table.coverage {
border-collapse: collapse;
margin: 10px 0 0 0;
padding: 0;
}
table.coverage td {
margin: 0;
padding: 0;
vertical-align: top;
}
table.coverage td.line-count {
text-align: right;
padding: 0 5px 0 20px;
}
table.coverage td.line-coverage {
text-align: right;
padding-right: 10px;
min-width:20px;
}
table.coverage td span.cline-any {
display: inline-block;
padding: 0 5px;
width: 100%;
}
.missing-if-branch {
display: inline-block;
margin-right: 5px;
border-radius: 3px;
position: relative;
padding: 0 4px;
background: #333;
color: yellow;
}
.skip-if-branch {
display: none;
margin-right: 10px;
position: relative;
padding: 0 4px;
background: #ccc;
color: white;
}
.missing-if-branch .typ, .skip-if-branch .typ {
color: inherit !important;
}
.coverage-summary {
border-collapse: collapse;
width: 100%;
}
.coverage-summary tr { border-bottom: 1px solid #bbb; }
.keyline-all { border: 1px solid #ddd; }
.coverage-summary td, .coverage-summary th { padding: 10px; }
.coverage-summary tbody { border: 1px solid #bbb; }
.coverage-summary td { border-right: 1px solid #bbb; }
.coverage-summary td:last-child { border-right: none; }
.coverage-summary th {
text-align: left;
font-weight: normal;
white-space: nowrap;
}
.coverage-summary th.file { border-right: none !important; }
.coverage-summary th.pct { }
.coverage-summary th.pic,
.coverage-summary th.abs,
.coverage-summary td.pct,
.coverage-summary td.abs { text-align: right; }
.coverage-summary td.file { white-space: nowrap; }
.coverage-summary td.pic { min-width: 120px !important; }
.coverage-summary tfoot td { }
.coverage-summary .sorter {
height: 10px;
width: 7px;
display: inline-block;
margin-left: 0.5em;
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
}
.coverage-summary .sorted .sorter {
background-position: 0 -20px;
}
.coverage-summary .sorted-desc .sorter {
background-position: 0 -10px;
}
.status-line { height: 10px; }
/* yellow */
.cbranch-no { background: yellow !important; color: #111; }
/* dark red */
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
.low .chart { border:1px solid #C21F39 }
.highlighted,
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
background: #C21F39 !important;
}
/* medium red */
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
/* light red */
.low, .cline-no { background:#FCE1E5 }
/* light green */
.high, .cline-yes { background:rgb(230,245,208) }
/* medium green */
.cstat-yes { background:rgb(161,215,106) }
/* dark green */
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
.high .chart { border:1px solid rgb(77,146,33) }
/* dark yellow (gold) */
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
.medium .chart { border:1px solid #f9cd0b; }
/* light yellow */
.medium { background: #fff4c2; }
.cstat-skip { background: #ddd; color: #111; }
.fstat-skip { background: #ddd; color: #111 !important; }
.cbranch-skip { background: #ddd !important; color: #111; }
span.cline-neutral { background: #eaeaea; }
.coverage-summary td.empty {
opacity: .5;
padding-top: 4px;
padding-bottom: 4px;
line-height: 1;
color: #888;
}
.cover-fill, .cover-empty {
display:inline-block;
height: 12px;
}
.chart {
line-height: 0;
}
.cover-empty {
background: white;
}
.cover-full {
border-right: none !important;
}
pre.prettyprint {
border: none !important;
padding: 0 !important;
margin: 0 !important;
}
.com { color: #999 !important; }
.ignore-none { color: #999; font-weight: normal; }
.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -48px;
}
.footer, .push {
height: 48px;
}

79
coverage/lcov-report/block-navigation.js generated Normal file
View File

@ -0,0 +1,79 @@
/* eslint-disable */
var jumpToCode = (function init() {
// Classes of code we would like to highlight in the file view
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
// Elements to highlight in the file listing view
var fileListingElements = ['td.pct.low'];
// We don't want to select elements that are direct descendants of another match
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
// Selecter that finds elements on the page to which we can jump
var selector =
fileListingElements.join(', ') +
', ' +
notSelector +
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
// The NodeList of matching elements
var missingCoverageElements = document.querySelectorAll(selector);
var currentIndex;
function toggleClass(index) {
missingCoverageElements
.item(currentIndex)
.classList.remove('highlighted');
missingCoverageElements.item(index).classList.add('highlighted');
}
function makeCurrent(index) {
toggleClass(index);
currentIndex = index;
missingCoverageElements.item(index).scrollIntoView({
behavior: 'smooth',
block: 'center',
inline: 'center'
});
}
function goToPrevious() {
var nextIndex = 0;
if (typeof currentIndex !== 'number' || currentIndex === 0) {
nextIndex = missingCoverageElements.length - 1;
} else if (missingCoverageElements.length > 1) {
nextIndex = currentIndex - 1;
}
makeCurrent(nextIndex);
}
function goToNext() {
var nextIndex = 0;
if (
typeof currentIndex === 'number' &&
currentIndex < missingCoverageElements.length - 1
) {
nextIndex = currentIndex + 1;
}
makeCurrent(nextIndex);
}
return function jump(event) {
switch (event.which) {
case 78: // n
case 74: // j
goToNext();
break;
case 66: // b
case 75: // k
case 80: // p
goToPrevious();
break;
}
};
})();
window.addEventListener('keydown', jumpToCode);

BIN
coverage/lcov-report/favicon.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

171
coverage/lcov-report/index.html generated Normal file
View File

@ -0,0 +1,171 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for All files</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="prettify.css" />
<link rel="stylesheet" href="base.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1>All files</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">79.52% </span>
<span class="quiet">Statements</span>
<span class='fraction'>893/1123</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">68.1% </span>
<span class="quiet">Branches</span>
<span class='fraction'>111/163</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">84.91% </span>
<span class="quiet">Functions</span>
<span class='fraction'>45/53</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">79.52% </span>
<span class="quiet">Lines</span>
<span class='fraction'>893/1123</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="node-ipc"><a href="node-ipc/index.html">node-ipc</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
</tr>
<tr>
<td class="file medium" data-value="node-ipc/dao"><a href="node-ipc/dao/index.html">node-ipc/dao</a></td>
<td data-value="79.15" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
</td>
<td data-value="79.15" class="pct medium">79.15%</td>
<td data-value="657" class="abs medium">520/657</td>
<td data-value="67.03" class="pct medium">67.03%</td>
<td data-value="91" class="abs medium">61/91</td>
<td data-value="95.65" class="pct high">95.65%</td>
<td data-value="23" class="abs high">22/23</td>
<td data-value="79.15" class="pct medium">79.15%</td>
<td data-value="657" class="abs medium">520/657</td>
</tr>
<tr>
<td class="file high" data-value="node-ipc/entities"><a href="node-ipc/entities/index.html">node-ipc/entities</a></td>
<td data-value="93" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 93%"></div><div class="cover-empty" style="width: 7%"></div></div>
</td>
<td data-value="93" class="pct high">93%</td>
<td data-value="100" class="abs high">93/100</td>
<td data-value="75" class="pct medium">75%</td>
<td data-value="16" class="abs medium">12/16</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="6" class="abs high">6/6</td>
<td data-value="93" class="pct high">93%</td>
<td data-value="100" class="abs high">93/100</td>
</tr>
<tr>
<td class="file high" data-value="node-ipc/helpers"><a href="node-ipc/helpers/index.html">node-ipc/helpers</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
</tr>
<tr>
<td class="file medium" data-value="node-ipc/services"><a href="node-ipc/services/index.html">node-ipc/services</a></td>
<td data-value="74.48" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
<td data-value="64" class="pct medium">64%</td>
<td data-value="50" class="abs medium">32/50</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="21" class="abs medium">14/21</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="sorter.js"></script>
<script src="block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,854 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/dao/client.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/dao</a> client.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">78.68% </span>
<span class="quiet">Statements</span>
<span class='fraction'>203/258</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">63.64% </span>
<span class="quiet">Branches</span>
<span class='fraction'>21/33</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">78.68% </span>
<span class="quiet">Lines</span>
<span class='fraction'>203/258</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a>
<a name='L230'></a><a href='#L230'>230</a>
<a name='L231'></a><a href='#L231'>231</a>
<a name='L232'></a><a href='#L232'>232</a>
<a name='L233'></a><a href='#L233'>233</a>
<a name='L234'></a><a href='#L234'>234</a>
<a name='L235'></a><a href='#L235'>235</a>
<a name='L236'></a><a href='#L236'>236</a>
<a name='L237'></a><a href='#L237'>237</a>
<a name='L238'></a><a href='#L238'>238</a>
<a name='L239'></a><a href='#L239'>239</a>
<a name='L240'></a><a href='#L240'>240</a>
<a name='L241'></a><a href='#L241'>241</a>
<a name='L242'></a><a href='#L242'>242</a>
<a name='L243'></a><a href='#L243'>243</a>
<a name='L244'></a><a href='#L244'>244</a>
<a name='L245'></a><a href='#L245'>245</a>
<a name='L246'></a><a href='#L246'>246</a>
<a name='L247'></a><a href='#L247'>247</a>
<a name='L248'></a><a href='#L248'>248</a>
<a name='L249'></a><a href='#L249'>249</a>
<a name='L250'></a><a href='#L250'>250</a>
<a name='L251'></a><a href='#L251'>251</a>
<a name='L252'></a><a href='#L252'>252</a>
<a name='L253'></a><a href='#L253'>253</a>
<a name='L254'></a><a href='#L254'>254</a>
<a name='L255'></a><a href='#L255'>255</a>
<a name='L256'></a><a href='#L256'>256</a>
<a name='L257'></a><a href='#L257'>257</a>
<a name='L258'></a><a href='#L258'>258</a>
<a name='L259'></a><a href='#L259'>259</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import net from 'net';
import tls from 'tls';
import EventParser from '../entities/EventParser.js';
import Message from 'js-message';
import fs from 'fs';
import Queue from 'js-queue';
import Events from 'event-pubsub';
&nbsp;
let eventParser = new EventParser();
&nbsp;
class Client extends Events{
constructor(config,log){
super();
this.config=config;
this.log=log;
this.publish=super.emit;
(config.maxRetries)? this.retriesRemaining=config.maxRetries<span class="branch-0 cbranch-no" title="branch not covered" >:0;</span>
&nbsp;
eventParser=new EventParser(this.config);
}
&nbsp;
Client=Client;
queue =new Queue;
socket=false;
connect=connect;
emit=emit;
retriesRemaining=0;
explicitlyDisconnected=false;
}
&nbsp;
function emit(type,data){
this.log('dispatching event to ', this.id, this.path, ' : ', type, ',', data);
&nbsp;
let message=new Message;
message.type=type;
message.data=data;
&nbsp;
if(this.config.rawBuffer)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > message=Buffer.from(type,this.config.encoding);</span>
}else{
message=eventParser.format(message);
}
&nbsp;
//volitile emit
if(!this.config.sync){
this.socket.write(message);
return;
}
&nbsp;
//sync, non-volitile, ack emit
this.queue.add(
syncEmit.bind(this,message)
);
}
&nbsp;
function syncEmit(message){
this.log('dispatching event to ', this.id, this.path, ' : ', message);
this.socket.write(message);
}
&nbsp;
function connect(){
//init client object for scope persistance especially inside of socket events.
let client=this;
&nbsp;
client.log('requested connection to ', client.id, client.path);
if(!this.path)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > client.log('\n\n######\nerror: ', client.id ,' client has not specified socket path it wishes to connect to.');</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
const options={};
&nbsp;
if(!client.port){
client.log('Connecting client on Unix Socket :', client.path);
&nbsp;
options.path=client.path;
&nbsp;
if (process.platform ==='win32' &amp;&amp; !client.path.startsWith('\\\\.\\pipe\\')){
options.path = options.path.replace(/^\//, '');
options.path = options.path.replace(/\//g, '-');
options.path= `\\\\.\\pipe\\${options.path}`;
}
&nbsp;
client.socket = net.connect(options);
}else{
options.host=client.path;
options.port=client.port;
&nbsp;
if(client.config.interface.localAddress)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.localAddress=client.config.interface.localAddress;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.localPort)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.localPort=client.config.interface.localPort;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.family)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.family=client.config.interface.family;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.hints)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.hints=client.config.interface.hints;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.lookup)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.lookup=client.config.interface.lookup;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(!client.config.tls){
client.log('Connecting client via TCP to', options);
client.socket = net.connect(options);
}<span class="branch-0 cbranch-no" title="branch not covered" >else{</span>
<span class="cstat-no" title="statement not covered" > client.log('Connecting client via TLS to', client.path ,client.port,client.config.tls);</span>
<span class="cstat-no" title="statement not covered" > if(client.config.tls.private){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.key=fs.readFileSync(client.config.tls.private);</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > if(client.config.tls.public){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.cert=fs.readFileSync(client.config.tls.public);</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > if(client.config.tls.trustedConnections){</span>
<span class="cstat-no" title="statement not covered" > if(typeof client.config.tls.trustedConnections === 'string'){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.trustedConnections=[client.config.tls.trustedConnections];</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.ca=[];</span>
<span class="cstat-no" title="statement not covered" > for(let i=0; i&lt;client.config.tls.trustedConnections.length; i++){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.ca.push(</span>
<span class="cstat-no" title="statement not covered" > fs.readFileSync(client.config.tls.trustedConnections[i])</span>
<span class="cstat-no" title="statement not covered" > );</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" ></span>
<span class="cstat-no" title="statement not covered" > Object.assign(client.config.tls,options);</span>
<span class="cstat-no" title="statement not covered" ></span>
<span class="cstat-no" title="statement not covered" > client.socket = tls.connect(</span>
<span class="cstat-no" title="statement not covered" > client.config.tls</span>
<span class="cstat-no" title="statement not covered" > );</span>
<span class="cstat-no" title="statement not covered" > }</span>
}
&nbsp;
client.socket.setEncoding(this.config.encoding);
&nbsp;
client.socket.on(
'error',
function(err){
client.log('\n\n######\nerror: ', err);
client.publish('error', err);
&nbsp;
}
);
&nbsp;
client.socket.on(
'connect',
function connectionMade(){
client.publish('connect');
client.retriesRemaining=client.config.maxRetries;
client.log('retrying reset');
}
);
&nbsp;
client.socket.on(
'close',
function connectionClosed(){
client.log('connection closed' ,client.id , client.path,
client.retriesRemaining, 'tries remaining of', client.config.maxRetries
);
&nbsp;
if(
client.config.stopRetrying ||
client.retriesRemaining&lt;1 ||
client.explicitlyDisconnected
&nbsp;
){
client.publish('disconnect');
client.log(
(client.config.id),
'exceeded connection rety amount of',
' or stopRetrying flag set.'
);
&nbsp;
client.socket.destroy();
client.publish('destroy');
client=undefined;
&nbsp;
return;
}
&nbsp;
setTimeout(
function retryTimeout(){
if (client.explicitlyDisconnected) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
client.retriesRemaining--;
client.connect();
}.bind(null,client),
client.config.retry
);
&nbsp;
client.publish('disconnect');
}
);
&nbsp;
client.socket.on(
'data',
function(data) {
client.log('## received events ##');
if(client.config.rawBuffer)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > client.publish(</span>
<span class="cstat-no" title="statement not covered" > 'data',</span>
<span class="cstat-no" title="statement not covered" > Buffer.from(data,client.config.encoding)</span>
<span class="cstat-no" title="statement not covered" > );</span>
<span class="cstat-no" title="statement not covered" > if(!client.config.sync){</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" ></span>
<span class="cstat-no" title="statement not covered" > client.queue.next();</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(!this.ipcBuffer){
this.ipcBuffer='';
}
&nbsp;
data=(this.ipcBuffer+=data);
&nbsp;
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > client.log('Messages are large, You may want to consider smaller messages.');</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
this.ipcBuffer='';
&nbsp;
const events = eventParser.parse(data);
const eCount = events.length;
for(let i=0; i&lt;eCount; i++){
let message=new Message;
message.load(events[i]);
&nbsp;
client.log('detected event', message.type, message.data);
client.publish(
message.type,
message.data
);
}
&nbsp;
if(!client.config.sync){
return;
}
&nbsp;
client.queue.next();
}
);
}
&nbsp;
export {
Client as default,
Client
};
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,126 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/dao</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/dao</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">79.15% </span>
<span class="quiet">Statements</span>
<span class='fraction'>520/657</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">67.03% </span>
<span class="quiet">Branches</span>
<span class='fraction'>61/91</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.65% </span>
<span class="quiet">Functions</span>
<span class='fraction'>22/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">79.15% </span>
<span class="quiet">Lines</span>
<span class='fraction'>520/657</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="client.js"><a href="client.js.html">client.js</a></td>
<td data-value="78.68" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 78%"></div><div class="cover-empty" style="width: 22%"></div></div>
</td>
<td data-value="78.68" class="pct medium">78.68%</td>
<td data-value="258" class="abs medium">203/258</td>
<td data-value="63.64" class="pct medium">63.64%</td>
<td data-value="33" class="abs medium">21/33</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">8/8</td>
<td data-value="78.68" class="pct medium">78.68%</td>
<td data-value="258" class="abs medium">203/258</td>
</tr>
<tr>
<td class="file medium" data-value="socketServer.js"><a href="socketServer.js.html">socketServer.js</a></td>
<td data-value="79.45" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
</td>
<td data-value="79.45" class="pct medium">79.45%</td>
<td data-value="399" class="abs medium">317/399</td>
<td data-value="68.97" class="pct medium">68.97%</td>
<td data-value="58" class="abs medium">40/58</td>
<td data-value="93.33" class="pct high">93.33%</td>
<td data-value="15" class="abs high">14/15</td>
<td data-value="79.45" class="pct medium">79.45%</td>
<td data-value="399" class="abs medium">317/399</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,278 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/entities/Defaults.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/entities</a> Defaults.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.42% </span>
<span class="quiet">Statements</span>
<span class='fraction'>61/66</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">57.14% </span>
<span class="quiet">Branches</span>
<span class='fraction'>4/7</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">92.42% </span>
<span class="quiet">Lines</span>
<span class='fraction'>61/66</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import os from 'os';
&nbsp;
class Defaults{
&nbsp;
constructor(){
&nbsp;
}
&nbsp;
&nbsp;
appspace='app.';
socketRoot='/tmp/';
id=os.hostname();
&nbsp;
encoding='utf8';
rawBuffer=false;
sync=false;
unlink=true;
&nbsp;
delimiter='\f';
&nbsp;
silent=false;
logDepth=5;
logInColor=true;
logger=console.log.bind(console);
&nbsp;
maxConnections=100;
retry=500;
maxRetries=Infinity;
stopRetrying=false;
&nbsp;
IPType=getIPType();
tls=false;
networkHost = (this.IPType == 'IPv6') <span class="branch-0 cbranch-no" title="branch not covered" >? '::1' </span>: '127.0.0.1';
networkPort = 8000;
&nbsp;
readableAll = false;
writableAll = false;
&nbsp;
interface={
localAddress:false,
localPort:false,
family:false,
hints:false,
lookup:false
}
}
&nbsp;
function getIPType() {
const networkInterfaces = os.networkInterfaces();
let IPType = '';
if (networkInterfaces
&amp;&amp; Array.isArray(networkInterfaces)
<span class="branch-0 cbranch-no" title="branch not covered" > &amp;&amp; networkInterfaces.length &gt; 0)</span> <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > // getting the family of first network interface available</span>
<span class="cstat-no" title="statement not covered" > IPType = networkInterfaces [</span>
<span class="cstat-no" title="statement not covered" > Object.keys( networkInterfaces )[0]</span>
<span class="cstat-no" title="statement not covered" > ][0].family;</span>
<span class="cstat-no" title="statement not covered" > }</span>
return IPType;
}
&nbsp;
export {
Defaults as default,
Defaults
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,182 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/entities/EventParser.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/entities</a> EventParser.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">94.12% </span>
<span class="quiet">Statements</span>
<span class='fraction'>32/34</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.89% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.12% </span>
<span class="quiet">Lines</span>
<span class='fraction'>32/34</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&nbsp;
import Defaults from './Defaults.js';
&nbsp;
class Parser{
constructor(config){
if(!config){
config=new Defaults;
}
this.delimiter=config.delimiter;
}
&nbsp;
format(message){
if(!message.data &amp;&amp; message.data!==false &amp;&amp; message.data!==0){
message.data={};
}
if(message.data['_maxListeners'])<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > message.data={};</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
message=message.JSON+this.delimiter;
return message;
}
&nbsp;
parse(data){
let events=data.split(this.delimiter);
events.pop();
return events;
}
}
&nbsp;
export {
Parser as default,
Parser
};
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,126 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/entities</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/entities</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">93% </span>
<span class="quiet">Statements</span>
<span class='fraction'>93/100</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Branches</span>
<span class='fraction'>12/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93% </span>
<span class="quiet">Lines</span>
<span class='fraction'>93/100</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="Defaults.js"><a href="Defaults.js.html">Defaults.js</a></td>
<td data-value="92.42" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 92%"></div><div class="cover-empty" style="width: 8%"></div></div>
</td>
<td data-value="92.42" class="pct high">92.42%</td>
<td data-value="66" class="abs high">61/66</td>
<td data-value="57.14" class="pct medium">57.14%</td>
<td data-value="7" class="abs medium">4/7</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="92.42" class="pct high">92.42%</td>
<td data-value="66" class="abs high">61/66</td>
</tr>
<tr>
<td class="file high" data-value="EventParser.js"><a href="EventParser.js.html">EventParser.js</a></td>
<td data-value="94.12" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 94%"></div><div class="cover-empty" style="width: 6%"></div></div>
</td>
<td data-value="94.12" class="pct high">94.12%</td>
<td data-value="34" class="abs high">32/34</td>
<td data-value="88.89" class="pct high">88.89%</td>
<td data-value="9" class="abs high">8/9</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="94.12" class="pct high">94.12%</td>
<td data-value="34" class="abs high">32/34</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,113 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/helpers/delay.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/helpers</a> delay.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>12/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>12/12</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span></td><td class="text"><pre class="prettyprint lang-js">async function delay(ms=100) {
return new Promise(
resolve =&gt; {
setTimeout(resolve, ms);
}
);
}
&nbsp;
export {
delay as default,
delay
}</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/helpers</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/helpers</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>12/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>12/12</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="delay.js"><a href="delay.js.html">delay.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

111
coverage/lcov-report/node-ipc/index.html generated Normal file
View File

@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> node-ipc</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>17/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>17/17</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="node-ipc.js"><a href="node-ipc.js.html">node-ipc.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,131 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/node-ipc.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">node-ipc</a> node-ipc.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>17/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>17/17</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import IPC from './services/IPC.js';
&nbsp;
class IPCModule extends IPC{
constructor(){
super();
&nbsp;
}
&nbsp;
IPC=IPC;
}
&nbsp;
const singleton=new IPCModule;
&nbsp;
export {
singleton as default,
IPCModule
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/services</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/services</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">74.48% </span>
<span class="quiet">Statements</span>
<span class='fraction'>251/337</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">64% </span>
<span class="quiet">Branches</span>
<span class='fraction'>32/50</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.67% </span>
<span class="quiet">Functions</span>
<span class='fraction'>14/21</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">74.48% </span>
<span class="quiet">Lines</span>
<span class='fraction'>251/337</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="IPC.js"><a href="IPC.js.html">IPC.js</a></td>
<td data-value="74.48" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
<td data-value="64" class="pct medium">64%</td>
<td data-value="50" class="abs medium">32/50</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="21" class="abs medium">14/21</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:26 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 209 B

View File

@ -1,5 +1,6 @@
var addSorting = (function () {
"use strict";
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
@ -7,13 +8,21 @@ var addSorting = (function () {
};
// returns the summary table element
function getTable() { return document.querySelector('.coverage-summary'); }
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() { return getTable().querySelector('thead tr'); }
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() { return getTable().querySelector('tbody'); }
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
// loads all columns
function loadColumns() {
@ -33,7 +42,8 @@ var addSorting = (function () {
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
@ -70,7 +80,7 @@ var addSorting = (function () {
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function (a, b) {
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
@ -82,7 +92,7 @@ var addSorting = (function () {
i;
if (desc) {
finalSorter = function (a, b) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
@ -108,7 +118,9 @@ var addSorting = (function () {
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
@ -117,7 +129,7 @@ var addSorting = (function () {
ithSorter = function ithSorter(i) {
var col = cols[i];
return function () {
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
@ -130,7 +142,7 @@ var addSorting = (function () {
addSortIndicators();
};
};
for (i =0 ; i < cols.length; i += 1) {
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
@ -144,12 +156,12 @@ var addSorting = (function () {
}
}
// adds sorting functionality to the UI
return function () {
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData(cols);
loadData();
addSortIndicators();
enableUI();
};

1455
coverage/lcov.info generated Normal file

File diff suppressed because it is too large Load Diff

18
coverage/lcov.svg generated Normal file
View File

@ -0,0 +1,18 @@
<svg xmlns="http://www.w3.org/2000/svg" width="86" height="18">
<linearGradient id="smooth" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".7"/>
<stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
<stop offset=".9" stop-color="#000" stop-opacity=".3"/>
<stop offset="1" stop-color="#000" stop-opacity=".5"/>
</linearGradient>
<rect rx="4" width="86" height="18" fill="#555"/>
<rect rx="4" x="58" width="28" height="18" fill="#4c1"/>
<rect x="58" width="4" height="18" fill="#4c1"/>
<rect rx="4" width="86" height="18" fill="url(#smooth)"/>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
<text x="30" y="14" fill="#010101" fill-opacity=".3">coverage</text>
<text x="30" y="13">coverage</text>
<text x="71" y="14" fill="#010101" fill-opacity=".3">80%</text>
<text x="71" y="13">80%</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 930 B

854
coverage/node-ipc/dao/client.js.html generated Normal file
View File

@ -0,0 +1,854 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/dao/client.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/dao</a> client.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">78.68% </span>
<span class="quiet">Statements</span>
<span class='fraction'>203/258</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">63.64% </span>
<span class="quiet">Branches</span>
<span class='fraction'>21/33</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">78.68% </span>
<span class="quiet">Lines</span>
<span class='fraction'>203/258</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a>
<a name='L68'></a><a href='#L68'>68</a>
<a name='L69'></a><a href='#L69'>69</a>
<a name='L70'></a><a href='#L70'>70</a>
<a name='L71'></a><a href='#L71'>71</a>
<a name='L72'></a><a href='#L72'>72</a>
<a name='L73'></a><a href='#L73'>73</a>
<a name='L74'></a><a href='#L74'>74</a>
<a name='L75'></a><a href='#L75'>75</a>
<a name='L76'></a><a href='#L76'>76</a>
<a name='L77'></a><a href='#L77'>77</a>
<a name='L78'></a><a href='#L78'>78</a>
<a name='L79'></a><a href='#L79'>79</a>
<a name='L80'></a><a href='#L80'>80</a>
<a name='L81'></a><a href='#L81'>81</a>
<a name='L82'></a><a href='#L82'>82</a>
<a name='L83'></a><a href='#L83'>83</a>
<a name='L84'></a><a href='#L84'>84</a>
<a name='L85'></a><a href='#L85'>85</a>
<a name='L86'></a><a href='#L86'>86</a>
<a name='L87'></a><a href='#L87'>87</a>
<a name='L88'></a><a href='#L88'>88</a>
<a name='L89'></a><a href='#L89'>89</a>
<a name='L90'></a><a href='#L90'>90</a>
<a name='L91'></a><a href='#L91'>91</a>
<a name='L92'></a><a href='#L92'>92</a>
<a name='L93'></a><a href='#L93'>93</a>
<a name='L94'></a><a href='#L94'>94</a>
<a name='L95'></a><a href='#L95'>95</a>
<a name='L96'></a><a href='#L96'>96</a>
<a name='L97'></a><a href='#L97'>97</a>
<a name='L98'></a><a href='#L98'>98</a>
<a name='L99'></a><a href='#L99'>99</a>
<a name='L100'></a><a href='#L100'>100</a>
<a name='L101'></a><a href='#L101'>101</a>
<a name='L102'></a><a href='#L102'>102</a>
<a name='L103'></a><a href='#L103'>103</a>
<a name='L104'></a><a href='#L104'>104</a>
<a name='L105'></a><a href='#L105'>105</a>
<a name='L106'></a><a href='#L106'>106</a>
<a name='L107'></a><a href='#L107'>107</a>
<a name='L108'></a><a href='#L108'>108</a>
<a name='L109'></a><a href='#L109'>109</a>
<a name='L110'></a><a href='#L110'>110</a>
<a name='L111'></a><a href='#L111'>111</a>
<a name='L112'></a><a href='#L112'>112</a>
<a name='L113'></a><a href='#L113'>113</a>
<a name='L114'></a><a href='#L114'>114</a>
<a name='L115'></a><a href='#L115'>115</a>
<a name='L116'></a><a href='#L116'>116</a>
<a name='L117'></a><a href='#L117'>117</a>
<a name='L118'></a><a href='#L118'>118</a>
<a name='L119'></a><a href='#L119'>119</a>
<a name='L120'></a><a href='#L120'>120</a>
<a name='L121'></a><a href='#L121'>121</a>
<a name='L122'></a><a href='#L122'>122</a>
<a name='L123'></a><a href='#L123'>123</a>
<a name='L124'></a><a href='#L124'>124</a>
<a name='L125'></a><a href='#L125'>125</a>
<a name='L126'></a><a href='#L126'>126</a>
<a name='L127'></a><a href='#L127'>127</a>
<a name='L128'></a><a href='#L128'>128</a>
<a name='L129'></a><a href='#L129'>129</a>
<a name='L130'></a><a href='#L130'>130</a>
<a name='L131'></a><a href='#L131'>131</a>
<a name='L132'></a><a href='#L132'>132</a>
<a name='L133'></a><a href='#L133'>133</a>
<a name='L134'></a><a href='#L134'>134</a>
<a name='L135'></a><a href='#L135'>135</a>
<a name='L136'></a><a href='#L136'>136</a>
<a name='L137'></a><a href='#L137'>137</a>
<a name='L138'></a><a href='#L138'>138</a>
<a name='L139'></a><a href='#L139'>139</a>
<a name='L140'></a><a href='#L140'>140</a>
<a name='L141'></a><a href='#L141'>141</a>
<a name='L142'></a><a href='#L142'>142</a>
<a name='L143'></a><a href='#L143'>143</a>
<a name='L144'></a><a href='#L144'>144</a>
<a name='L145'></a><a href='#L145'>145</a>
<a name='L146'></a><a href='#L146'>146</a>
<a name='L147'></a><a href='#L147'>147</a>
<a name='L148'></a><a href='#L148'>148</a>
<a name='L149'></a><a href='#L149'>149</a>
<a name='L150'></a><a href='#L150'>150</a>
<a name='L151'></a><a href='#L151'>151</a>
<a name='L152'></a><a href='#L152'>152</a>
<a name='L153'></a><a href='#L153'>153</a>
<a name='L154'></a><a href='#L154'>154</a>
<a name='L155'></a><a href='#L155'>155</a>
<a name='L156'></a><a href='#L156'>156</a>
<a name='L157'></a><a href='#L157'>157</a>
<a name='L158'></a><a href='#L158'>158</a>
<a name='L159'></a><a href='#L159'>159</a>
<a name='L160'></a><a href='#L160'>160</a>
<a name='L161'></a><a href='#L161'>161</a>
<a name='L162'></a><a href='#L162'>162</a>
<a name='L163'></a><a href='#L163'>163</a>
<a name='L164'></a><a href='#L164'>164</a>
<a name='L165'></a><a href='#L165'>165</a>
<a name='L166'></a><a href='#L166'>166</a>
<a name='L167'></a><a href='#L167'>167</a>
<a name='L168'></a><a href='#L168'>168</a>
<a name='L169'></a><a href='#L169'>169</a>
<a name='L170'></a><a href='#L170'>170</a>
<a name='L171'></a><a href='#L171'>171</a>
<a name='L172'></a><a href='#L172'>172</a>
<a name='L173'></a><a href='#L173'>173</a>
<a name='L174'></a><a href='#L174'>174</a>
<a name='L175'></a><a href='#L175'>175</a>
<a name='L176'></a><a href='#L176'>176</a>
<a name='L177'></a><a href='#L177'>177</a>
<a name='L178'></a><a href='#L178'>178</a>
<a name='L179'></a><a href='#L179'>179</a>
<a name='L180'></a><a href='#L180'>180</a>
<a name='L181'></a><a href='#L181'>181</a>
<a name='L182'></a><a href='#L182'>182</a>
<a name='L183'></a><a href='#L183'>183</a>
<a name='L184'></a><a href='#L184'>184</a>
<a name='L185'></a><a href='#L185'>185</a>
<a name='L186'></a><a href='#L186'>186</a>
<a name='L187'></a><a href='#L187'>187</a>
<a name='L188'></a><a href='#L188'>188</a>
<a name='L189'></a><a href='#L189'>189</a>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a>
<a name='L204'></a><a href='#L204'>204</a>
<a name='L205'></a><a href='#L205'>205</a>
<a name='L206'></a><a href='#L206'>206</a>
<a name='L207'></a><a href='#L207'>207</a>
<a name='L208'></a><a href='#L208'>208</a>
<a name='L209'></a><a href='#L209'>209</a>
<a name='L210'></a><a href='#L210'>210</a>
<a name='L211'></a><a href='#L211'>211</a>
<a name='L212'></a><a href='#L212'>212</a>
<a name='L213'></a><a href='#L213'>213</a>
<a name='L214'></a><a href='#L214'>214</a>
<a name='L215'></a><a href='#L215'>215</a>
<a name='L216'></a><a href='#L216'>216</a>
<a name='L217'></a><a href='#L217'>217</a>
<a name='L218'></a><a href='#L218'>218</a>
<a name='L219'></a><a href='#L219'>219</a>
<a name='L220'></a><a href='#L220'>220</a>
<a name='L221'></a><a href='#L221'>221</a>
<a name='L222'></a><a href='#L222'>222</a>
<a name='L223'></a><a href='#L223'>223</a>
<a name='L224'></a><a href='#L224'>224</a>
<a name='L225'></a><a href='#L225'>225</a>
<a name='L226'></a><a href='#L226'>226</a>
<a name='L227'></a><a href='#L227'>227</a>
<a name='L228'></a><a href='#L228'>228</a>
<a name='L229'></a><a href='#L229'>229</a>
<a name='L230'></a><a href='#L230'>230</a>
<a name='L231'></a><a href='#L231'>231</a>
<a name='L232'></a><a href='#L232'>232</a>
<a name='L233'></a><a href='#L233'>233</a>
<a name='L234'></a><a href='#L234'>234</a>
<a name='L235'></a><a href='#L235'>235</a>
<a name='L236'></a><a href='#L236'>236</a>
<a name='L237'></a><a href='#L237'>237</a>
<a name='L238'></a><a href='#L238'>238</a>
<a name='L239'></a><a href='#L239'>239</a>
<a name='L240'></a><a href='#L240'>240</a>
<a name='L241'></a><a href='#L241'>241</a>
<a name='L242'></a><a href='#L242'>242</a>
<a name='L243'></a><a href='#L243'>243</a>
<a name='L244'></a><a href='#L244'>244</a>
<a name='L245'></a><a href='#L245'>245</a>
<a name='L246'></a><a href='#L246'>246</a>
<a name='L247'></a><a href='#L247'>247</a>
<a name='L248'></a><a href='#L248'>248</a>
<a name='L249'></a><a href='#L249'>249</a>
<a name='L250'></a><a href='#L250'>250</a>
<a name='L251'></a><a href='#L251'>251</a>
<a name='L252'></a><a href='#L252'>252</a>
<a name='L253'></a><a href='#L253'>253</a>
<a name='L254'></a><a href='#L254'>254</a>
<a name='L255'></a><a href='#L255'>255</a>
<a name='L256'></a><a href='#L256'>256</a>
<a name='L257'></a><a href='#L257'>257</a>
<a name='L258'></a><a href='#L258'>258</a>
<a name='L259'></a><a href='#L259'>259</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">12x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">6x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">18x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">16x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">19x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-yes">8x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">20x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import net from 'net';
import tls from 'tls';
import EventParser from '../entities/EventParser.js';
import Message from 'js-message';
import fs from 'fs';
import Queue from 'js-queue';
import Events from 'event-pubsub';
&nbsp;
let eventParser = new EventParser();
&nbsp;
class Client extends Events{
constructor(config,log){
super();
this.config=config;
this.log=log;
this.publish=super.emit;
(config.maxRetries)? this.retriesRemaining=config.maxRetries<span class="branch-0 cbranch-no" title="branch not covered" >:0;</span>
&nbsp;
eventParser=new EventParser(this.config);
}
&nbsp;
Client=Client;
queue =new Queue;
socket=false;
connect=connect;
emit=emit;
retriesRemaining=0;
explicitlyDisconnected=false;
}
&nbsp;
function emit(type,data){
this.log('dispatching event to ', this.id, this.path, ' : ', type, ',', data);
&nbsp;
let message=new Message;
message.type=type;
message.data=data;
&nbsp;
if(this.config.rawBuffer)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > message=Buffer.from(type,this.config.encoding);</span>
}else{
message=eventParser.format(message);
}
&nbsp;
//volitile emit
if(!this.config.sync){
this.socket.write(message);
return;
}
&nbsp;
//sync, non-volitile, ack emit
this.queue.add(
syncEmit.bind(this,message)
);
}
&nbsp;
function syncEmit(message){
this.log('dispatching event to ', this.id, this.path, ' : ', message);
this.socket.write(message);
}
&nbsp;
function connect(){
//init client object for scope persistance especially inside of socket events.
let client=this;
&nbsp;
client.log('requested connection to ', client.id, client.path);
if(!this.path)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > client.log('\n\n######\nerror: ', client.id ,' client has not specified socket path it wishes to connect to.');</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
const options={};
&nbsp;
if(!client.port){
client.log('Connecting client on Unix Socket :', client.path);
&nbsp;
options.path=client.path;
&nbsp;
if (process.platform ==='win32' &amp;&amp; !client.path.startsWith('\\\\.\\pipe\\')){
options.path = options.path.replace(/^\//, '');
options.path = options.path.replace(/\//g, '-');
options.path= `\\\\.\\pipe\\${options.path}`;
}
&nbsp;
client.socket = net.connect(options);
}else{
options.host=client.path;
options.port=client.port;
&nbsp;
if(client.config.interface.localAddress)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.localAddress=client.config.interface.localAddress;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.localPort)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.localPort=client.config.interface.localPort;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.family)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.family=client.config.interface.family;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.hints)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.hints=client.config.interface.hints;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(client.config.interface.lookup)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > options.lookup=client.config.interface.lookup;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(!client.config.tls){
client.log('Connecting client via TCP to', options);
client.socket = net.connect(options);
}<span class="branch-0 cbranch-no" title="branch not covered" >else{</span>
<span class="cstat-no" title="statement not covered" > client.log('Connecting client via TLS to', client.path ,client.port,client.config.tls);</span>
<span class="cstat-no" title="statement not covered" > if(client.config.tls.private){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.key=fs.readFileSync(client.config.tls.private);</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > if(client.config.tls.public){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.cert=fs.readFileSync(client.config.tls.public);</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > if(client.config.tls.trustedConnections){</span>
<span class="cstat-no" title="statement not covered" > if(typeof client.config.tls.trustedConnections === 'string'){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.trustedConnections=[client.config.tls.trustedConnections];</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.ca=[];</span>
<span class="cstat-no" title="statement not covered" > for(let i=0; i&lt;client.config.tls.trustedConnections.length; i++){</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.ca.push(</span>
<span class="cstat-no" title="statement not covered" > fs.readFileSync(client.config.tls.trustedConnections[i])</span>
<span class="cstat-no" title="statement not covered" > );</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" ></span>
<span class="cstat-no" title="statement not covered" > Object.assign(client.config.tls,options);</span>
<span class="cstat-no" title="statement not covered" ></span>
<span class="cstat-no" title="statement not covered" > client.socket = tls.connect(</span>
<span class="cstat-no" title="statement not covered" > client.config.tls</span>
<span class="cstat-no" title="statement not covered" > );</span>
<span class="cstat-no" title="statement not covered" > }</span>
}
&nbsp;
client.socket.setEncoding(this.config.encoding);
&nbsp;
client.socket.on(
'error',
function(err){
client.log('\n\n######\nerror: ', err);
client.publish('error', err);
&nbsp;
}
);
&nbsp;
client.socket.on(
'connect',
function connectionMade(){
client.publish('connect');
client.retriesRemaining=client.config.maxRetries;
client.log('retrying reset');
}
);
&nbsp;
client.socket.on(
'close',
function connectionClosed(){
client.log('connection closed' ,client.id , client.path,
client.retriesRemaining, 'tries remaining of', client.config.maxRetries
);
&nbsp;
if(
client.config.stopRetrying ||
client.retriesRemaining&lt;1 ||
client.explicitlyDisconnected
&nbsp;
){
client.publish('disconnect');
client.log(
(client.config.id),
'exceeded connection rety amount of',
' or stopRetrying flag set.'
);
&nbsp;
client.socket.destroy();
client.publish('destroy');
client=undefined;
&nbsp;
return;
}
&nbsp;
setTimeout(
function retryTimeout(){
if (client.explicitlyDisconnected) <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
client.retriesRemaining--;
client.connect();
}.bind(null,client),
client.config.retry
);
&nbsp;
client.publish('disconnect');
}
);
&nbsp;
client.socket.on(
'data',
function(data) {
client.log('## received events ##');
if(client.config.rawBuffer)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > client.publish(</span>
<span class="cstat-no" title="statement not covered" > 'data',</span>
<span class="cstat-no" title="statement not covered" > Buffer.from(data,client.config.encoding)</span>
<span class="cstat-no" title="statement not covered" > );</span>
<span class="cstat-no" title="statement not covered" > if(!client.config.sync){</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
<span class="cstat-no" title="statement not covered" ></span>
<span class="cstat-no" title="statement not covered" > client.queue.next();</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
if(!this.ipcBuffer){
this.ipcBuffer='';
}
&nbsp;
data=(this.ipcBuffer+=data);
&nbsp;
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1)<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > client.log('Messages are large, You may want to consider smaller messages.');</span>
<span class="cstat-no" title="statement not covered" > return;</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
this.ipcBuffer='';
&nbsp;
const events = eventParser.parse(data);
const eCount = events.length;
for(let i=0; i&lt;eCount; i++){
let message=new Message;
message.load(events[i]);
&nbsp;
client.log('detected event', message.type, message.data);
client.publish(
message.type,
message.data
);
}
&nbsp;
if(!client.config.sync){
return;
}
&nbsp;
client.queue.next();
}
);
}
&nbsp;
export {
Client as default,
Client
};
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

126
coverage/node-ipc/dao/index.html generated Normal file
View File

@ -0,0 +1,126 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/dao</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/dao</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">79.15% </span>
<span class="quiet">Statements</span>
<span class='fraction'>520/657</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">67.03% </span>
<span class="quiet">Branches</span>
<span class='fraction'>61/91</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">95.65% </span>
<span class="quiet">Functions</span>
<span class='fraction'>22/23</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">79.15% </span>
<span class="quiet">Lines</span>
<span class='fraction'>520/657</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="client.js"><a href="client.js.html">client.js</a></td>
<td data-value="78.68" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 78%"></div><div class="cover-empty" style="width: 22%"></div></div>
</td>
<td data-value="78.68" class="pct medium">78.68%</td>
<td data-value="258" class="abs medium">203/258</td>
<td data-value="63.64" class="pct medium">63.64%</td>
<td data-value="33" class="abs medium">21/33</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="8" class="abs high">8/8</td>
<td data-value="78.68" class="pct medium">78.68%</td>
<td data-value="258" class="abs medium">203/258</td>
</tr>
<tr>
<td class="file medium" data-value="socketServer.js"><a href="socketServer.js.html">socketServer.js</a></td>
<td data-value="79.45" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 79%"></div><div class="cover-empty" style="width: 21%"></div></div>
</td>
<td data-value="79.45" class="pct medium">79.45%</td>
<td data-value="399" class="abs medium">317/399</td>
<td data-value="68.97" class="pct medium">68.97%</td>
<td data-value="58" class="abs medium">40/58</td>
<td data-value="93.33" class="pct high">93.33%</td>
<td data-value="15" class="abs high">14/15</td>
<td data-value="79.45" class="pct medium">79.45%</td>
<td data-value="399" class="abs medium">317/399</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

1277
coverage/node-ipc/dao/socketServer.js.html generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,278 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/entities/Defaults.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/entities</a> Defaults.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">92.42% </span>
<span class="quiet">Statements</span>
<span class='fraction'>61/66</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">57.14% </span>
<span class="quiet">Branches</span>
<span class='fraction'>4/7</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">92.42% </span>
<span class="quiet">Lines</span>
<span class='fraction'>61/66</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a>
<a name='L52'></a><a href='#L52'>52</a>
<a name='L53'></a><a href='#L53'>53</a>
<a name='L54'></a><a href='#L54'>54</a>
<a name='L55'></a><a href='#L55'>55</a>
<a name='L56'></a><a href='#L56'>56</a>
<a name='L57'></a><a href='#L57'>57</a>
<a name='L58'></a><a href='#L58'>58</a>
<a name='L59'></a><a href='#L59'>59</a>
<a name='L60'></a><a href='#L60'>60</a>
<a name='L61'></a><a href='#L61'>61</a>
<a name='L62'></a><a href='#L62'>62</a>
<a name='L63'></a><a href='#L63'>63</a>
<a name='L64'></a><a href='#L64'>64</a>
<a name='L65'></a><a href='#L65'>65</a>
<a name='L66'></a><a href='#L66'>66</a>
<a name='L67'></a><a href='#L67'>67</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import os from 'os';
&nbsp;
class Defaults{
&nbsp;
constructor(){
&nbsp;
}
&nbsp;
&nbsp;
appspace='app.';
socketRoot='/tmp/';
id=os.hostname();
&nbsp;
encoding='utf8';
rawBuffer=false;
sync=false;
unlink=true;
&nbsp;
delimiter='\f';
&nbsp;
silent=false;
logDepth=5;
logInColor=true;
logger=console.log.bind(console);
&nbsp;
maxConnections=100;
retry=500;
maxRetries=Infinity;
stopRetrying=false;
&nbsp;
IPType=getIPType();
tls=false;
networkHost = (this.IPType == 'IPv6') <span class="branch-0 cbranch-no" title="branch not covered" >? '::1' </span>: '127.0.0.1';
networkPort = 8000;
&nbsp;
readableAll = false;
writableAll = false;
&nbsp;
interface={
localAddress:false,
localPort:false,
family:false,
hints:false,
lookup:false
}
}
&nbsp;
function getIPType() {
const networkInterfaces = os.networkInterfaces();
let IPType = '';
if (networkInterfaces
&amp;&amp; Array.isArray(networkInterfaces)
<span class="branch-0 cbranch-no" title="branch not covered" > &amp;&amp; networkInterfaces.length &gt; 0)</span> <span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > // getting the family of first network interface available</span>
<span class="cstat-no" title="statement not covered" > IPType = networkInterfaces [</span>
<span class="cstat-no" title="statement not covered" > Object.keys( networkInterfaces )[0]</span>
<span class="cstat-no" title="statement not covered" > ][0].family;</span>
<span class="cstat-no" title="statement not covered" > }</span>
return IPType;
}
&nbsp;
export {
Defaults as default,
Defaults
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

View File

@ -0,0 +1,182 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/entities/EventParser.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/entities</a> EventParser.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">94.12% </span>
<span class="quiet">Statements</span>
<span class='fraction'>32/34</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.89% </span>
<span class="quiet">Branches</span>
<span class='fraction'>8/9</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">94.12% </span>
<span class="quiet">Lines</span>
<span class='fraction'>32/34</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">14x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">28x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">9x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">26x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">25x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&nbsp;
import Defaults from './Defaults.js';
&nbsp;
class Parser{
constructor(config){
if(!config){
config=new Defaults;
}
this.delimiter=config.delimiter;
}
&nbsp;
format(message){
if(!message.data &amp;&amp; message.data!==false &amp;&amp; message.data!==0){
message.data={};
}
if(message.data['_maxListeners'])<span class="branch-0 cbranch-no" title="branch not covered" >{</span>
<span class="cstat-no" title="statement not covered" > message.data={};</span>
<span class="cstat-no" title="statement not covered" > }</span>
&nbsp;
message=message.JSON+this.delimiter;
return message;
}
&nbsp;
parse(data){
let events=data.split(this.delimiter);
events.pop();
return events;
}
}
&nbsp;
export {
Parser as default,
Parser
};
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

126
coverage/node-ipc/entities/index.html generated Normal file
View File

@ -0,0 +1,126 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/entities</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/entities</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">93% </span>
<span class="quiet">Statements</span>
<span class='fraction'>93/100</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">75% </span>
<span class="quiet">Branches</span>
<span class='fraction'>12/16</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/6</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">93% </span>
<span class="quiet">Lines</span>
<span class='fraction'>93/100</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="Defaults.js"><a href="Defaults.js.html">Defaults.js</a></td>
<td data-value="92.42" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 92%"></div><div class="cover-empty" style="width: 8%"></div></div>
</td>
<td data-value="92.42" class="pct high">92.42%</td>
<td data-value="66" class="abs high">61/66</td>
<td data-value="57.14" class="pct medium">57.14%</td>
<td data-value="7" class="abs medium">4/7</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="92.42" class="pct high">92.42%</td>
<td data-value="66" class="abs high">61/66</td>
</tr>
<tr>
<td class="file high" data-value="EventParser.js"><a href="EventParser.js.html">EventParser.js</a></td>
<td data-value="94.12" class="pic high">
<div class="chart"><div class="cover-fill" style="width: 94%"></div><div class="cover-empty" style="width: 6%"></div></div>
</td>
<td data-value="94.12" class="pct high">94.12%</td>
<td data-value="34" class="abs high">32/34</td>
<td data-value="88.89" class="pct high">88.89%</td>
<td data-value="9" class="abs high">8/9</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="94.12" class="pct high">94.12%</td>
<td data-value="34" class="abs high">32/34</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

113
coverage/node-ipc/helpers/delay.js.html generated Normal file
View File

@ -0,0 +1,113 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/helpers/delay.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> / <a href="index.html">node-ipc/helpers</a> delay.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>12/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>12/12</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">10x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span></td><td class="text"><pre class="prettyprint lang-js">async function delay(ms=100) {
return new Promise(
resolve =&gt; {
setTimeout(resolve, ms);
}
);
}
&nbsp;
export {
delay as default,
delay
}</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

111
coverage/node-ipc/helpers/index.html generated Normal file
View File

@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/helpers</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/helpers</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>12/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>12/12</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="delay.js"><a href="delay.js.html">delay.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="1" class="abs high">1/1</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="12" class="abs high">12/12</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

111
coverage/node-ipc/index.html generated Normal file
View File

@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> node-ipc</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>17/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>17/17</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file high" data-value="node-ipc.js"><a href="node-ipc.js.html">node-ipc.js</a></td>
<td data-value="100" class="pic high">
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="3" class="abs high">3/3</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="17" class="abs high">17/17</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

131
coverage/node-ipc/node-ipc.js.html generated Normal file
View File

@ -0,0 +1,131 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/node-ipc.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../index.html">All files</a> / <a href="index.html">node-ipc</a> node-ipc.js</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>17/17</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>3/3</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>2/2</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>17/17</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">15x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-yes">7x</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import IPC from './services/IPC.js';
&nbsp;
class IPCModule extends IPC{
constructor(){
super();
&nbsp;
}
&nbsp;
IPC=IPC;
}
&nbsp;
const singleton=new IPCModule;
&nbsp;
export {
singleton as default,
IPCModule
}
&nbsp;</pre></td></tr></table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

1091
coverage/node-ipc/services/IPC.js.html generated Normal file

File diff suppressed because it is too large Load Diff

111
coverage/node-ipc/services/index.html generated Normal file
View File

@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/services</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../../sort-arrow-sprite.png);
}
</style>
</head>
<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="../../index.html">All files</a> node-ipc/services</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">74.48% </span>
<span class="quiet">Statements</span>
<span class='fraction'>251/337</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">64% </span>
<span class="quiet">Branches</span>
<span class='fraction'>32/50</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.67% </span>
<span class="quiet">Functions</span>
<span class='fraction'>14/21</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">74.48% </span>
<span class="quiet">Lines</span>
<span class='fraction'>251/337</span>
</div>
</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
</div>
<div class='status-line medium'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
<tr>
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="IPC.js"><a href="IPC.js.html">IPC.js</a></td>
<td data-value="74.48" class="pic medium">
<div class="chart"><div class="cover-fill" style="width: 74%"></div><div class="cover-empty" style="width: 26%"></div></div>
</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
<td data-value="64" class="pct medium">64%</td>
<td data-value="50" class="abs medium">32/50</td>
<td data-value="66.67" class="pct medium">66.67%</td>
<td data-value="21" class="abs medium">14/21</td>
<td data-value="74.48" class="pct medium">74.48%</td>
<td data-value="337" class="abs medium">251/337</td>
</tr>
</tbody>
</table>
</div>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
at Wed Jul 07 2021 13:15:27 GMT-0700 (Pacific Daylight Time)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../../sorter.js"></script>
<script src="../../block-navigation.js"></script>
</body>
</html>

1
coverage/prettify.css generated Normal file
View File

@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

2
coverage/prettify.js generated Normal file

File diff suppressed because one or more lines are too long

BIN
coverage/sort-arrow-sprite.png generated Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

170
coverage/sorter.js generated Normal file
View File

@ -0,0 +1,170 @@
/* eslint-disable */
var addSorting = (function() {
'use strict';
var cols,
currentSort = {
index: 0,
desc: false
};
// returns the summary table element
function getTable() {
return document.querySelector('.coverage-summary');
}
// returns the thead element of the summary table
function getTableHeader() {
return getTable().querySelector('thead tr');
}
// returns the tbody element of the summary table
function getTableBody() {
return getTable().querySelector('tbody');
}
// returns the th element for nth column
function getNthColumn(n) {
return getTableHeader().querySelectorAll('th')[n];
}
// loads all columns
function loadColumns() {
var colNodes = getTableHeader().querySelectorAll('th'),
colNode,
cols = [],
col,
i;
for (i = 0; i < colNodes.length; i += 1) {
colNode = colNodes[i];
col = {
key: colNode.getAttribute('data-col'),
sortable: !colNode.getAttribute('data-nosort'),
type: colNode.getAttribute('data-type') || 'string'
};
cols.push(col);
if (col.sortable) {
col.defaultDescSort = col.type === 'number';
colNode.innerHTML =
colNode.innerHTML + '<span class="sorter"></span>';
}
}
return cols;
}
// attaches a data attribute to every tr element with an object
// of data values keyed by column name
function loadRowData(tableRow) {
var tableCols = tableRow.querySelectorAll('td'),
colNode,
col,
data = {},
i,
val;
for (i = 0; i < tableCols.length; i += 1) {
colNode = tableCols[i];
col = cols[i];
val = colNode.getAttribute('data-value');
if (col.type === 'number') {
val = Number(val);
}
data[col.key] = val;
}
return data;
}
// loads all row data
function loadData() {
var rows = getTableBody().querySelectorAll('tr'),
i;
for (i = 0; i < rows.length; i += 1) {
rows[i].data = loadRowData(rows[i]);
}
}
// sorts the table using the data for the ith column
function sortByIndex(index, desc) {
var key = cols[index].key,
sorter = function(a, b) {
a = a.data[key];
b = b.data[key];
return a < b ? -1 : a > b ? 1 : 0;
},
finalSorter = sorter,
tableBody = document.querySelector('.coverage-summary tbody'),
rowNodes = tableBody.querySelectorAll('tr'),
rows = [],
i;
if (desc) {
finalSorter = function(a, b) {
return -1 * sorter(a, b);
};
}
for (i = 0; i < rowNodes.length; i += 1) {
rows.push(rowNodes[i]);
tableBody.removeChild(rowNodes[i]);
}
rows.sort(finalSorter);
for (i = 0; i < rows.length; i += 1) {
tableBody.appendChild(rows[i]);
}
}
// removes sort indicators for current column being sorted
function removeSortIndicators() {
var col = getNthColumn(currentSort.index),
cls = col.className;
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
col.className = cls;
}
// adds sort indicators for current column being sorted
function addSortIndicators() {
getNthColumn(currentSort.index).className += currentSort.desc
? ' sorted-desc'
: ' sorted';
}
// adds event listeners for all sorter widgets
function enableUI() {
var i,
el,
ithSorter = function ithSorter(i) {
var col = cols[i];
return function() {
var desc = col.defaultDescSort;
if (currentSort.index === i) {
desc = !currentSort.desc;
}
sortByIndex(i, desc);
removeSortIndicators();
currentSort.index = i;
currentSort.desc = desc;
addSortIndicators();
};
};
for (i = 0; i < cols.length; i += 1) {
if (cols[i].sortable) {
// add the click event handler on the th so users
// dont have to click on those tiny arrows
el = getNthColumn(i).querySelector('.sorter').parentElement;
if (el.addEventListener) {
el.addEventListener('click', ithSorter(i));
} else {
el.attachEvent('onclick', ithSorter(i));
}
}
}
}
// adds sorting functionality to the UI
return function() {
if (!getTable()) {
return;
}
cols = loadColumns();
loadData();
addSortIndicators();
enableUI();
};
})();
window.addEventListener('load', addSorting);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,54 +1,61 @@
'use strict';
import net from 'net';
import tls from 'tls';
import EventParser from '../entities/EventParser.js';
import Message from 'js-message';
import fs from 'fs';
import Queue from 'js-queue';
import Events from 'event-pubsub';
const net = require('net'),
tls = require('tls'),
eventParser = require('./eventParser.js'),
Pubsub = require('event-pubsub'),
Message = require('js-message'),
fs = require('fs'),
Queue = require('js-queue');
let eventParser = new EventParser();
function init(config,log){
let client={
config : config,
queue : new Queue,
socket : false,
connect : connect,
emit : emit,
log : log,
retriesRemaining:config.maxRetries||0
};
class Client extends Events{
constructor(config,log){
super();
this.config=config;
this.log=log;
this.publish=super.emit;
(config.maxRetries)? this.retriesRemaining=config.maxRetries:0;
new Pubsub(client);
eventParser=new EventParser(this.config);
}
return client;
Client=Client;
queue =new Queue;
socket=false;
connect=connect;
emit=emit;
retriesRemaining=0;
explicitlyDisconnected=false;
}
function emit(type,data){
this.log('dispatching event to '.debug, (this.id).variable, this.path.variable,' : ', type.data,',', data);
this.log('dispatching event to ', this.id, this.path, ' : ', type, ',', data);
let message=new Message;
message.type=type;
message.data=data;
if(this.config.rawBuffer){
message=new Buffer(type,this.encoding);
message=Buffer.from(type,this.config.encoding);
}else{
message=eventParser.format(message);
}
//volitile emit
if(!this.config.sync){
this.socket.write(message);
return;
}
//sync, non-volitile, ack emit
this.queue.add(
syncEmit.bind(this,message)
);
}
function syncEmit(message){
this.log('dispatching event to '.debug, (this.id).variable, this.path.variable,' : ', message.data);
this.log('dispatching event to ', this.id, this.path, ' : ', message);
this.socket.write(message);
}
@ -56,38 +63,55 @@ function connect(){
//init client object for scope persistance especially inside of socket events.
let client=this;
client.log('requested connection to '.debug, client.id.variable, client.path.variable);
client.log('requested connection to ', client.id, client.path);
if(!this.path){
client.log('\n\n######\nerror: '.error, client.id .info,' client has not specified socket path it wishes to connect to.'.error);
client.log('\n\n######\nerror: ', client.id ,' client has not specified socket path it wishes to connect to.');
return;
}
if(!client.port){
client.log('Connecting client on Unix Socket :'.debug, client.path.variable);
const options={};
let path = client.path;
if(!client.port){
client.log('Connecting client on Unix Socket :', client.path);
options.path=client.path;
if (process.platform ==='win32' && !client.path.startsWith('\\\\.\\pipe\\')){
path = path.replace(/^\//, '');
path = path.replace(/\//g, '-');
path= `\\\\.\\pipe\\${path}`;
options.path = options.path.replace(/^\//, '');
options.path = options.path.replace(/\//g, '-');
options.path= `\\\\.\\pipe\\${options.path}`;
}
client.socket = net.connect(
{
path: path
}
);
client.socket = net.connect(options);
}else{
options.host=client.path;
options.port=client.port;
if(client.config.interface.localAddress){
options.localAddress=client.config.interface.localAddress;
}
if(client.config.interface.localPort){
options.localPort=client.config.interface.localPort;
}
if(client.config.interface.family){
options.family=client.config.interface.family;
}
if(client.config.interface.hints){
options.hints=client.config.interface.hints;
}
if(client.config.interface.lookup){
options.lookup=client.config.interface.lookup;
}
if(!client.config.tls){
client.log('Connecting client via TCP to'.debug, client.path.variable ,client.port);
client.socket = net.connect(
{
port:client.port,
host:client.path
}
);
client.log('Connecting client via TCP to', options);
client.socket = net.connect(options);
}else{
client.log('Connecting client via TLS to'.debug, client.path.variable ,client.port,client.config.tls);
client.log('Connecting client via TLS to', client.path ,client.port,client.config.tls);
if(client.config.tls.private){
client.config.tls.key=fs.readFileSync(client.config.tls.private);
}
@ -106,8 +130,7 @@ function connect(){
}
}
client.config.tls.host=client.path;
client.config.tls.port=client.port;
Object.assign(client.config.tls,options);
client.socket = tls.connect(
client.config.tls
@ -120,8 +143,8 @@ function connect(){
client.socket.on(
'error',
function(err){
client.log('\n\n######\nerror: '.error, err);
client.trigger('error', err);
client.log('\n\n######\nerror: ', err);
client.publish('error', err);
}
);
@ -129,7 +152,7 @@ function connect(){
client.socket.on(
'connect',
function connectionMade(){
client.trigger('connect');
client.publish('connect');
client.retriesRemaining=client.config.maxRetries;
client.log('retrying reset');
}
@ -138,59 +161,53 @@ function connect(){
client.socket.on(
'close',
function connectionClosed(){
client.log('connection closed'.notice ,client.id.variable , client.path.variable,
`${client.retriesRemaining} tries remaining of ${client.config.maxRetries}`
client.log('connection closed' ,client.id , client.path,
client.retriesRemaining, 'tries remaining of', client.config.maxRetries
);
if(
client.config.stopRetrying || client.retriesRemaining<1
client.config.stopRetrying ||
client.retriesRemaining<1 ||
client.explicitlyDisconnected
){
client.trigger('disconnect');
client.publish('disconnect');
client.log(
(client.config.id).variable,
'exceeded connection rety amount of'.warn,
(client.config.id),
'exceeded connection rety amount of',
' or stopRetrying flag set.'
);
client.socket.destroy();
client.trigger('destroy');
client.publish('destroy');
client=undefined;
return;
}
client.isRetrying=true;
setTimeout(
function retryTimeout(){
if (client.explicitlyDisconnected) {
return;
}
client.retriesRemaining--;
client.isRetrying=false;
client.connect();
setTimeout(
function resetRetriesCheck(){
if(!client.isRetrying){
client.retriesRemaining=client.config.maxRetries;
}
},
100
);
}.bind(null,client),
client.config.retry
);
client.trigger('disconnect');
client.publish('disconnect');
}
);
client.socket.on(
'data',
function(data) {
client.log('## recieved events ##'.rainbow);
client.log('## received events ##');
if(client.config.rawBuffer){
client.trigger(
client.publish(
'data',
new Buffer(data,this.encoding)
Buffer.from(data,client.config.encoding)
);
if(!client.config.sync){
return;
@ -207,7 +224,7 @@ function connect(){
data=(this.ipcBuffer+=data);
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
client.log('Implementing larger buffer for this socket message. You may want to consider smaller messages'.notice);
client.log('Messages are large, You may want to consider smaller messages.');
return;
}
@ -219,8 +236,8 @@ function connect(){
let message=new Message;
message.load(events[i]);
client.log('detected event of type '.debug, message.type.data, message.data);
client.trigger(
client.log('detected event', message.type, message.data);
client.publish(
message.type,
message.data
);
@ -235,4 +252,7 @@ function connect(){
);
}
module.exports=init;
export {
Client as default,
Client
};

View File

@ -1,27 +0,0 @@
'use strict';
const parser={
parse : parseDataEvents,
format : formatData,
delimiter : '\f'
};
function formatData(message){
if(!message.data && message.data!==false && message.data!==0){
message.data={};
}
if(message.data['_maxListeners']){
message.data={};
}
message=message.JSON+parser.delimiter;
return message;
}
function parseDataEvents(data){
let events=data.split(parser.delimiter);
events.pop();
return events;
}
module.exports=parser;

View File

@ -1,22 +1,77 @@
'use strict';
const net = require('net'),
tls = require('tls'),
fs = require('fs'),
dgram = require('dgram'),
eventParser = require('./eventParser.js'),
Pubsub = require('event-pubsub'),
Message = require('js-message');
import net from 'net';
import tls from 'tls';
import fs from 'fs';
import dgram from 'dgram';
import EventParser from '../entities/EventParser.js';
import Message from 'js-message';
import Events from 'event-pubsub';
let eventParser = new EventParser();
class Server extends Events{
constructor(path,config,log,port){
super();
this.config = config;
this.path = path;
this.port = port;
this.log = log;
this.publish=super.emit;
eventParser=new EventParser(this.config);
this.on(
'close',
serverClosed.bind(this)
);
}
udp4=false;
udp6=false;
server=false;
sockets=[];
emit=emit;
broadcast=broadcast;
onStart(socket){
this.publish(
'start',
socket
);
}
stop(){
this.server.close();
}
start(){
if(!this.path){
this.log('Socket Server Path not specified, refusing to start');
return;
}
if(this.config.unlink){
fs.unlink(
this.path,
startServer.bind(this)
);
}else{
startServer.bind(this)();
}
}
}
function emit(socket, type, data){
this.log('dispatching event to socket'.debug, ' : ', type.data, data);
this.log('dispatching event to socket', ' : ', type, data);
let message=new Message;
message.type=type;
message.data=data;
if(this.config.rawBuffer){
message=new Buffer(type,this.encoding);
this.log(this.config.encoding)
message=Buffer.from(type,this.config.encoding);
}else{
message=eventParser.format(message);
}
@ -35,18 +90,18 @@ function emit(socket, type, data){
);
return;
}
socket.write(message);
}
function broadcast(type,data){
this.log('broadcasting event to all known sockets listening to '.debug, this.path.variable,' : ', ((this.port)?this.port:''), type, data);
this.log('broadcasting event to all known sockets listening to ', this.path,' : ', ((this.port)?this.port:''), type, data);
let message=new Message;
message.type=type;
message.data=data;
if(this.config.rawBuffer){
message=new Buffer(type,this.encoding);
message=Buffer.from(type,this.config.encoding);
}else{
message=eventParser.format(message);
}
@ -62,312 +117,283 @@ function broadcast(type,data){
}
}
function init(path,config,log,port){
let server={
config : config,
path : path,
port : port,
udp4 : false,
udp6 : false,
log : log,
server : false,
sockets : [],
emit : emit,
broadcast : broadcast,
onStart : function onStart(socket){
this.trigger(
'start',
socket
);
},
stop:function stop(){
server.server.close();
},
start : function start(){
if(!this.path){
server.log('Socket Server Path not specified, refusing to start'.warn);
function serverClosed(){
for(let i=0, count=this.sockets.length; i<count; i++){
let socket=this.sockets[i];
let destroyedSocketId=false;
if(socket){
if(socket.readable){
continue;
}
}
if(socket.id){
destroyedSocketId=socket.id;
}
this.log('socket disconnected',destroyedSocketId.toString());
if(socket && socket.destroy){
socket.destroy();
}
this.sockets.splice(i,1);
this.publish('socket.disconnected', socket, destroyedSocketId);
return;
}
}
function gotData(socket,data,UDPSocket){
let sock=((this.udp4 || this.udp6)? UDPSocket : socket);
if(this.config.rawBuffer){
data=Buffer.from(data,this.config.encoding);
this.publish(
'data',
data,
sock
);
return;
}
if(!sock.ipcBuffer){
sock.ipcBuffer='';
}
data=(sock.ipcBuffer+=data);
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
this.log('Messages are large, You may want to consider smaller messages.');
return;
}
sock.ipcBuffer='';
data=eventParser.parse(data);
while(data.length>0){
let message=new Message;
message.load(data.shift());
// Only set the sock id if it is specified.
if (message.data && message.data.id){
sock.id=message.data.id;
}
this.log('received event of : ',message.type,message.data);
this.publish(
message.type,
message.data,
sock
);
}
}
function socketClosed(socket){
this.publish(
'close',
socket
);
}
function serverCreated(socket) {
this.sockets.push(socket);
if(socket.setEncoding){
socket.setEncoding(this.config.encoding);
}
this.log('## socket connection to server detected ##');
socket.on(
'close',
socketClosed.bind(this)
);
socket.on(
'error',
function(err){
this.log('server socket error',err);
this.publish('error',err);
}.bind(this)
);
socket.on(
'data',
gotData.bind(this,socket)
);
socket.on(
'message',
function(msg,rinfo) {
if (!rinfo){
return;
}
fs.unlink(
this.path,
function () {
server.log(
'starting server on '.debug,server.path.variable,
((server.port)?`:${server.port}`:'').variable
);
this.log('Received UDP message from ', rinfo.address, rinfo.port);
let data;
if(!server.udp4 && !server.udp6){
if(!server.config.tls){
server.server=net.createServer(
serverCreated
);
}else{
server.log('starting TLS server'.debug,server.config.tls);
if(server.config.tls.private){
server.config.tls.key=fs.readFileSync(server.config.tls.private);
}else{
server.config.tls.key=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`);
}
if(server.config.tls.public){
server.config.tls.cert=fs.readFileSync(server.config.tls.public);
}else{
server.config.tls.cert=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`);
}
if(server.config.tls.dhparam){
server.config.tls.dhparam=fs.readFileSync(server.config.tls.dhparam);
}
if(server.config.tls.trustedConnections){
if(typeof server.config.tls.trustedConnections === 'string'){
server.config.tls.trustedConnections=[server.config.tls.trustedConnections];
}
server.config.tls.ca=[];
for(let i=0; i<server.config.tls.trustedConnections.length; i++){
server.config.tls.ca.push(
fs.readFileSync(server.config.tls.trustedConnections[i])
);
}
}
server.server=tls.createServer(
server.config.tls,
serverCreated
);
}
}else{
function UDPWrite(message,socket){
let data=new Buffer(message, server.config.encoding);
server.server.send(
data,
0,
data.length,
socket.port,
socket.address,
function(err, bytes) {
if(err){
server.log('error writing data to socket'.warn,err);
server.trigger(
'error',
function(err){
server.trigger('error',err);
}
);
}
}
);
}
if(this.config.rawSocket){
data=Buffer.from(msg,this.config.encoding);
}else{
data=msg.toString();
}
socket.emit('data',data,rinfo);
}.bind(this)
);
server.server=dgram.createSocket(
((server.udp4)? 'udp4':'udp6')
);
server.server.write=UDPWrite;
server.server.on(
'listening',
function () {
serverCreated(server.server);
}
);
}
this.publish(
'connect',
socket
);
server.server.on(
'error',
function(err){
server.log('server error'.warn,err);
if(this.config.rawBuffer){
return;
}
}
server.trigger(
'error',
err
);
}
);
function startServer() {
this.log(
'starting server on ',this.path,
((this.port)?`:${this.port}`:'')
);
server.server.maxConnections=server.config.maxConnections;
if(!this.udp4 && !this.udp6){
this.log('starting TLS server',this.config.tls);
if(!this.config.tls){
this.server=net.createServer(
serverCreated.bind(this)
);
}else{
startTLSServer.bind(this)();
}
}else{
this.server=dgram.createSocket(
((this.udp4)? 'udp4':'udp6')
);
this.server.write=UDPWrite.bind(this);
this.server.on(
'listening',
function UDPServerStarted() {
serverCreated.bind(this)(this.server);
}.bind(this)
);
}
function serverCreated(socket) {
server.sockets.push(socket);
this.server.on(
'error',
function(err){
this.log('server error',err);
if(socket.setEncoding){
socket.setEncoding(server.config.encoding);
}
this.publish(
'error',
err
);
}.bind(this)
);
server.log('## socket connection to server detected ##'.rainbow);
socket.on(
'close',
function(socket){
server.trigger(
'close',
socket
);
}
);
this.server.maxConnections=this.config.maxConnections;
socket.on(
'error',
function(err){
server.log('server socket error'.warn,err);
if(!this.port){
this.log('starting server as', 'Unix || Windows Socket');
if (process.platform ==='win32'){
this.path = this.path.replace(/^\//, '');
this.path = this.path.replace(/\//g, '-');
this.path= `\\\\.\\pipe\\${this.path}`;
}
server.trigger('error',err);
}
);
this.server.listen({
path: this.path,
readableAll: this.config.readableAll,
writableAll: this.config.writableAll
}, this.onStart.bind(this));
socket.on(
'data',
function(data,UDPSocket){
let sock=((server.udp4 || server.udp6)? UDPSocket : socket);
if(server.config.rawBuffer){
data=new Buffer(data,this.encoding);
server.trigger(
'data',
data,
sock
);
return;
}
return;
}
if(!this.ipcBuffer){
this.ipcBuffer='';
}
if(!this.udp4 && !this.udp6){
this.log('starting server as', (this.config.tls?'TLS':'TCP'));
this.server.listen(
this.port,
this.path,
this.onStart.bind(this)
);
return;
}
data=(this.ipcBuffer+=data);
this.log('starting server as',((this.udp4)? 'udp4':'udp6'));
if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
server.log('Implementing larger buffer for this socket message. You may want to consider smaller messages'.notice);
return;
}
this.server.bind(
this.port,
this.path
);
this.ipcBuffer='';
this.onStart(
{
address : this.path,
port : this.port
}
);
}
data=eventParser.parse(data);
while(data.length>0){
let message=new Message;
message.load(data.shift());
server.log('received event of : '.debug,message.type.data,message.data);
if(message.data.id){
sock.id=message.data.id;
}
server.trigger(
message.type,
message.data,
sock
);
}
}
);
socket.on(
'message',
function(msg,rinfo) {
if (!rinfo){
return;
}
server.log('Received UDP message from '.debug, rinfo.address.variable, rinfo.port);
let data;
if(server.config.rawSocket){
data=new Buffer(msg,this.encoding);
}else{
data=msg.toString();
}
socket.emit('data',data,rinfo);
}
);
server.trigger(
'connect',
socket
);
if(server.config.rawBuffer){
return;
}
}
function started(socket){
server.onStart(socket);
}
if(!port){
server.log('starting server as'.debug, 'Unix || Windows Socket'.variable);
if (process.platform ==='win32'){
server.path = server.path.replace(/^\//, '');
server.path = server.path.replace(/\//g, '-');
server.path= `\\\\.\\pipe\\${server.path}`;
}
server.server.listen(
server.path,
started
);
return;
}
if(!server.udp4 && !server.udp6){
server.log('starting server as'.debug, (server.config.tls?'TLS':'TCP').variable);
server.server.listen(
server.port,
server.path,
started
);
return;
}
server.log('starting server as'.debug,((server.udp4)? 'udp4':'udp6').variable);
server.server.bind(
server.port,
server.path
);
started(
{
address : server.path,
port : server.port
}
);
}
function startTLSServer(){
this.log('starting TLS server',this.config.tls);
if(this.config.tls.private){
this.config.tls.key=fs.readFileSync(this.config.tls.private);
}else{
this.config.tls.key=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/private/server.key`);
}
if(this.config.tls.public){
this.config.tls.cert=fs.readFileSync(this.config.tls.public);
}else{
this.config.tls.cert=fs.readFileSync(`${__dirname}/../local-node-ipc-certs/server.pub`);
}
if(this.config.tls.dhparam){
this.config.tls.dhparam=fs.readFileSync(this.config.tls.dhparam);
}
if(this.config.tls.trustedConnections){
if(typeof this.config.tls.trustedConnections === 'string'){
this.config.tls.trustedConnections=[this.config.tls.trustedConnections];
}
this.config.tls.ca=[];
for(let i=0; i<this.config.tls.trustedConnections.length; i++){
this.config.tls.ca.push(
fs.readFileSync(this.config.tls.trustedConnections[i])
);
}
};
}
this.server=tls.createServer(
this.config.tls,
serverCreated.bind(this)
);
}
new Pubsub(server);
server.on(
'close',
function(){
for(let i=0, count=server.sockets.length; i<count; i++){
let socket=server.sockets[i];
let destroyedSocketId=false;
if(socket){
if(socket.readable){
continue;
function UDPWrite(message,socket){
let data=Buffer.from(message, this.config.encoding);
this.server.send(
data,
0,
data.length,
socket.port,
socket.address,
function(err, bytes) {
if(err){
this.log('error writing data to socket',err);
this.publish(
'error',
function(err){
this.publish('error',err);
}
}
if(socket.id){
destroyedSocketId=socket.id;
}
server.log('socket disconnected'.notice,destroyedSocketId.toString().variable);
if(socket && socket.destroy){
socket.destroy();
}
server.sockets.splice(i,1);
server.trigger('socket.disconnected', socket, destroyedSocketId);
return;
);
}
}
);
return server;
}
module.exports=init;
export {
Server as default,
Server
};

View File

@ -1,94 +1,66 @@
'use strict';
const os = require('os');
import os from 'os';
class Defaults{
constructor(){
const IPType=os.networkInterfaces()[
Object.keys(os.networkInterfaces())[0]
][0].family;
Object.defineProperties(
this,
{
appspace : {
enumerable:true,
writable:true,
value:'app.'
},
socketRoot : {
enumerable:true,
writable:true,
value:'/tmp/'
},
networkHost : {
enumerable:true,
writable:true,
value:(IPType=='IPv6')? '::1' : '127.0.0.1'
},
networkPort : {
enumerable:true,
writable:true,
value:8000
},
id : {
enumerable:true,
writable:true,
value:os.hostname()
},
encoding : {
enumerable:true,
writable:true,
value:'utf8'
},
rawBuffer : {
enumerable:true,
writable:true,
value:false
},
sync : {
enumerable:true,
writable:true,
value:false
},
silent : {
enumerable:true,
writable:true,
value:false
},
maxConnections : {
enumerable:true,
writable:true,
value:100
},
retry : {
enumerable:true,
writable:true,
value:500
},
maxRetries : {
enumerable:true,
writable:true,
value:Infinity
},
stopRetrying : {
enumerable:true,
writable:true,
value:false
},
IPType : {
enumerable:true,
writable:true,
value:IPType
},
tls : {
enumerable:true,
writable:true,
value:false
}
}
);
constructor(){
}
appspace='app.';
socketRoot='/tmp/';
id=os.hostname();
encoding='utf8';
rawBuffer=false;
sync=false;
unlink=true;
delimiter='\f';
silent=false;
logDepth=5;
logInColor=true;
logger=console.log.bind(console);
maxConnections=100;
retry=500;
maxRetries=Infinity;
stopRetrying=false;
IPType=getIPType();
tls=false;
networkHost = (this.IPType == 'IPv6') ? '::1' : '127.0.0.1';
networkPort = 8000;
readableAll = false;
writableAll = false;
interface={
localAddress:false,
localPort:false,
family:false,
hints:false,
lookup:false
}
}
module.exports=Defaults;
function getIPType() {
const networkInterfaces = os.networkInterfaces();
let IPType = '';
if (networkInterfaces
&& Array.isArray(networkInterfaces)
&& networkInterfaces.length > 0) {
// getting the family of first network interface available
IPType = networkInterfaces [
Object.keys( networkInterfaces )[0]
][0].family;
}
return IPType;
}
export {
Defaults as default,
Defaults
}

34
entities/EventParser.js Normal file
View File

@ -0,0 +1,34 @@
import Defaults from './Defaults.js';
class Parser{
constructor(config){
if(!config){
config=new Defaults;
}
this.delimiter=config.delimiter;
}
format(message){
if(!message.data && message.data!==false && message.data!==0){
message.data={};
}
if(message.data['_maxListeners']){
message.data={};
}
message=message.JSON+this.delimiter;
return message;
}
parse(data){
let events=data.split(this.delimiter);
events.pop();
return events;
}
}
export {
Parser as default,
Parser
};

View File

@ -1,15 +0,0 @@
'use strict';
class LogColors{
constructor(){
this.good='green';
this.notice='yellow';
this.warn='red';
this.error='redBG';
this.debug='magenta';
this.variable='cyan';
this.data='blue';
}
}
module.exports=LogColors;

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -17,7 +17,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'app.message',
{
@ -30,13 +30,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'kill.connection',
function(data){
ipc.log('world requested kill.connection'.notice);
ipc.log('world requested kill.connection');
ipc.disconnect('world');
}
);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -17,7 +17,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'app.message',
{
@ -30,19 +30,19 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'app.message',
function(data){
ipc.log('got a message from world : '.debug, data.message);
ipc.log('got a message from world : ', data.message);
}
);
ipc.of.world.on(
'kill.connection',
function(data){
ipc.log('world requested kill.connection'.notice);
ipc.log('world requested kill.connection');
ipc.disconnect('world');
}
);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -20,7 +20,7 @@ ipc.serveNet(
ipc.server.on(
'app.message',
function(data,socket){
ipc.log('got a message from'.debug, (data.id).variable, (data.message).data);
ipc.log('got a message from', (data.id), (data.message));
messages[data.id]=true;
ipc.server.emit(
socket,
@ -32,7 +32,7 @@ ipc.serveNet(
);
if(messages.hello && messages.goodbye){
ipc.log('got all required events, telling clients to kill connection'.good);
ipc.log('got all required events, telling clients to kill connection');
ipc.server.broadcast(
'kill.connection',
{

View File

@ -1,10 +1,10 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
*
* You should start both hello and world
* then you will see them communicating.
*
*
* *************************************/
ipc.config.id = 'hello';
@ -16,7 +16,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'message',
'hello'
@ -26,16 +26,14 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'message',
function(data){
ipc.log('got a message from world : '.debug, data);
ipc.log('got a message from world : ', data);
}
);
}
);
console.log(ipc);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -16,7 +16,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message : '.debug, data);
ipc.log('got a message : ', data);
ipc.server.emit(
socket,
'message',
@ -28,7 +28,7 @@ ipc.serveNet(
ipc.server.on(
'socket.disconnected',
function(data,socket){
console.log(arguments);
console.log('DISCONNECTED\n\n',arguments);
}
);
}
@ -37,7 +37,7 @@ ipc.serveNet(
ipc.server.on(
'error',
function(err){
ipc.log('Got an ERROR!'.warn,err);
ipc.log('Got an ERROR!',err);
}
);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -17,7 +17,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
//queue up a bunch of requests to be sent synchronously
for(var i=0; i<10; i++){
@ -31,13 +31,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'message',
function(data){
ipc.log('got a message from world : '.debug, data,'\n\n');
ipc.log('got a message from world : ', data,'\n\n');
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -16,7 +16,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message : '.debug, data);
ipc.log('got a message : ', data);
//fake some synch procedural code
setTimeout(
function(){

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -18,7 +18,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'hello'
);
@ -28,7 +28,7 @@ ipc.connectToNet(
ipc.of.world.on(
'data',
function(data){
ipc.log('got a message from world : '.debug, data,data.toString());
ipc.log('got a message from world : ', data,data.toString());
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -27,7 +27,7 @@ ipc.serveNet(
ipc.server.on(
'data',
function(data,socket){
ipc.log('got a message'.debug, data,data.toString());
ipc.log('got a message', data,data.toString());
ipc.server.emit(
socket,
'goodbye'

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -20,7 +20,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'app.message',
{
@ -33,13 +33,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'kill.connection',
function(data){
ipc.log('world requested kill.connection'.notice);
ipc.log('world requested kill.connection');
ipc.disconnect('world');
}
);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -20,7 +20,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'app.message',
{
@ -33,19 +33,19 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'app.message',
function(data){
ipc.log('got a message from world : '.debug, data.message);
ipc.log('got a message from world : ', data.message);
}
);
ipc.of.world.on(
'kill.connection',
function(data){
ipc.log('world requested kill.connection'.notice);
ipc.log('world requested kill.connection');
ipc.disconnect('world');
}
);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -24,7 +24,7 @@ ipc.serveNet(
ipc.server.on(
'app.message',
function(data,socket){
ipc.log('got a message from'.debug, (data.id).variable, (data.message).data);
ipc.log('got a message from', (data.id), (data.message));
messages[data.id]=true;
ipc.server.emit(
socket,
@ -36,7 +36,7 @@ ipc.serveNet(
);
if(messages.hello && messages.goodbye){
ipc.log('got all required events, telling clients to kill connection'.good);
ipc.log('got all required events, telling clients to kill connection');
ipc.server.broadcast(
'kill.connection',
{

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -19,7 +19,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'message',
'hello'
@ -29,13 +29,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'message',
function(data){
ipc.log('got a message from world : '.debug, data);
ipc.log('got a message from world : ', data);
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -19,7 +19,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message : '.debug, data);
ipc.log('got a message : ', data);
ipc.server.emit(
socket,
'message',

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -24,7 +24,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'message',
'hello'
@ -34,13 +34,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'message',
function(data){
ipc.log('got a message from world : '.debug, data);
ipc.log('got a message from world : ', data);
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -25,7 +25,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message : '.debug, data);
ipc.log('got a message : ', data);
ipc.server.emit(
socket,
'message',

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -25,7 +25,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'message',
'hello'
@ -35,13 +35,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'message',
function(data){
ipc.log('got a message from world : '.debug, data);
ipc.log('got a message from world : ', data);
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -26,7 +26,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message : '.debug, data);
ipc.log('got a message : ', data);
ipc.server.emit(
socket,
'message',

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -19,7 +19,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'message',
'hello'
@ -29,13 +29,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'message',
function(data){
ipc.log('got a message from world : '.debug, data);
ipc.log('got a message from world : ', data);
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -19,7 +19,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message : '.debug, data);
ipc.log('got a message : ', data);
ipc.server.emit(
socket,
'message',

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -20,7 +20,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
//queue up a bunch of requests to be sent synchronously
for(var i=0; i<10; i++){
@ -34,13 +34,13 @@ ipc.connectToNet(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'message',
function(data){
ipc.log('got a message from world : '.debug, data);
ipc.log('got a message from world : ', data);
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -20,7 +20,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message : '.debug, data);
ipc.log('got a message : ', data);
setTimeout(
function(){
ipc.server.emit(

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -28,7 +28,7 @@ ipc.connectToNet(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'hello'
);
@ -38,7 +38,7 @@ ipc.connectToNet(
ipc.of.world.on(
'data',
function(data){
ipc.log('got a message from world : '.debug, data,data.toString());
ipc.log('got a message from world : ', data,data.toString());
}
);
}

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -40,7 +40,7 @@ ipc.serveNet(
ipc.server.on(
'data',
function(data,socket){
ipc.log('got a message'.debug, data,data.toString());
ipc.log('got a message', data,data.toString());
ipc.server.emit(
socket,
'goodbye'

View File

@ -6,13 +6,14 @@ Still working on this. If you look at the examples and can help, please jump rig
#### important cli commands
- openssl genrsa -out server.key 2048
- openssl req -new -x509 -key server.key -out server.pub -days 365 -config openssl.cnf
- openssl req -new -x509 -key client.key -out client.pub -days 365 -config openssl.cnf
- talk about openssl.cnf edits
#### using the local node-ipc certs
This should **ONLY** be done on your local machine. Both the public and private certs are available here on git hub, so its not a good idea to use them over the network.
#### talk about security
- keep private keys private, don't shared
- keep private keys private, don't share
#### talk about using hostname not ip for best security validation of certs

View File

@ -1,18 +1,18 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
*
* Since there is no client relationship
* with UDP sockets sockets are not kept
* with UDP sockets sockets are not kept
* open.
*
*
* This means the order sockets are opened
* is important.
*
* Start World first. Then you can start
*
* Start World first. Then you can start
* hello or goodbye in any order you
* choose.
*
*
* *************************************/
ipc.config.id = 'goodbye';
@ -26,7 +26,7 @@ ipc.serveNet(
'message',
function(data){
ipc.log('got Data');
ipc.log('got a message from '.debug, data.id.variable ,' : '.debug, data.message.data);
ipc.log('got a message from ', data.id ,' : ', data.message);
}
);
ipc.server.emit(

View File

@ -1,20 +1,20 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
*
* Since there is no client relationship
* with UDP sockets sockets are not kept
* with UDP sockets sockets are not kept
* open.
*
*
* This means the order sockets are opened
* is important.
*
* Start World first. Then you can start
*
* Start World first. Then you can start
* hello or goodbye in any order you
* choose.
*
*
* *************************************/
ipc.config.id = 'hello';
ipc.config.retry= 1500;
@ -26,7 +26,7 @@ ipc.serveNet(
'message',
function(data){
ipc.log('got Data');
ipc.log('got a message from '.debug, data.id.variable ,' : '.debug, data.message.data);
ipc.log('got a message from ', data.id ,' : ', data.message);
}
);
ipc.server.emit(

View File

@ -1,18 +1,18 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
*
* Since there is no client relationship
* with UDP sockets sockets are not kept
* with UDP sockets sockets are not kept
* open.
*
*
* This means the order sockets are opened
* is important.
*
* Start World first. Then you can start
*
* Start World first. Then you can start
* hello or goodbye in any order you
* choose.
*
*
***************************************/
ipc.config.id = 'world';
@ -30,7 +30,7 @@ ipc.serveNet(
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message from '.debug, data.id.variable ,' : '.debug, data.message.data);
ipc.log('got a message from ', data.id ,' : ', data.message);
messages[data.id]=true;
ipc.server.emit(
socket,
@ -40,9 +40,9 @@ ipc.serveNet(
message : data.message+' world!'
}
);
if(messages.hello && messages.goodbye){
ipc.log('got all required events, telling evryone how muchg I am loved!'.good);
ipc.log('got all required events, telling evryone how muchg I am loved!');
ipc.server.broadcast(
'message',
{
@ -53,7 +53,7 @@ ipc.serveNet(
}
}
);
console.log(ipc.server);
}
);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -30,7 +30,7 @@ ipc.serveNet(
'message',
function(data){
ipc.log('got Data');
ipc.log('got a message from '.debug, data.id.variable ,' : '.debug, data.message.data);
ipc.log('got a message from ', data.id ,' : ', data.message);
}
);
ipc.server.emit(

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -25,11 +25,10 @@ ipc.config.retry= 1500;
ipc.serveNet(
'udp4',
function(){
console.log(123);
ipc.server.on(
'message',
function(data,socket){
ipc.log('got a message from '.debug, data.id.variable ,' : '.debug, data.message.data);
ipc.log('got a message from ', data.id ,' : ', data.message);
ipc.server.emit(
socket,
'message',

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -19,7 +19,7 @@ ipc.serveNet(
ipc.server.on(
'data',
function(data){
ipc.log('got a message from world '.debug, data, data.toString());
ipc.log('got a message from world ', data, data.toString());
}
);
ipc.server.emit(

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -30,7 +30,7 @@ ipc.serveNet(
ipc.server.on(
'data',
function(data,socket){
ipc.log('got a message'.debug, data,data.toString());
ipc.log('got a message', data,data.toString());
ipc.server.emit(
socket,
'goodbye'

View File

@ -0,0 +1,31 @@
import fs from 'fs';
import ipc from '../../node-ipc';
const socketPath = '/tmp/ipc.sock';
//loop forever so you can see the pid of the cluster sever change in the logs
setInterval(
function() {
ipc.connectTo(
'world',
socketPath,
connecting
);
},
2000
);
function connecting(socket) {
ipc.of.world.on(
'connect',
function() {
ipc.of.world.emit(
'currentDate',
{
message: new Date().toISOString()
}
);
ipc.disconnect('world');
}
);
}

View File

@ -0,0 +1,34 @@
import ipc from '../../../node-ipc.js';
import fs from 'fs';
import {cpus} from 'os';
import cluster from 'cluster';
const cpuCount=cpus().length;
const socketPath = '/tmp/ipc.sock';
ipc.config.unlink = false;
if (cluster.isMaster) {
if (fs.existsSync(socketPath)) {
fs.unlinkSync(socketPath);
}
for (let i = 0; i < cpuCount; i++) {
cluster.fork();
}
}else{
ipc.serve(
socketPath,
function() {
ipc.server.on(
'currentDate',
function(data,socket) {
console.log(`pid ${process.pid} got: `, data);
}
);
}
);
ipc.server.start();
console.log(`pid ${process.pid} listening on ${socketPath}`);
}

View File

@ -0,0 +1,42 @@
import ipc from '../../../node-ipc.js';
/***************************************\
*
* You should start both hello and world
* then you will see them communicating.
*
* *************************************/
ipc.config.id = 'hello';
ipc.config.retry= 1500;
ipc.config.rawBuffer=true;
ipc.config.encoding='hex';
ipc.connectTo(
'world',
function(){
ipc.of.world.on(
'connect',
function(){
//make a 6 byte buffer for example
const myBuffer=Buffer.alloc(6).fill(0);
myBuffer.writeUInt16BE(0x02,0);
myBuffer.writeUInt32BE(0xffeecc,2);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
myBuffer
);
}
);
ipc.of.world.on(
'data',
function(data){
ipc.log('got a message from world : ', data);
}
);
}
);

View File

@ -0,0 +1,40 @@
import ipc from '../../../node-ipc.js';
/***************************************\
*
* You should start both hello and world
* then you will see them communicating.
*
* *************************************/
ipc.config.id = 'world';
ipc.config.retry= 1500;
ipc.config.rawBuffer=true;
ipc.config.encoding='hex';
ipc.serve(
function(){
ipc.server.on(
'connect',
function(socket){
ipc.server.emit(
socket,
[0xaa]
);
}
);
ipc.server.on(
'data',
function(data,socket){
ipc.log('got a message', data);
ipc.server.emit(
socket,
[0x0d,0xee]
);
}
);
}
);
ipc.server.start();

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -16,7 +16,7 @@ ipc.connectTo(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'app.message',
{
@ -29,13 +29,13 @@ ipc.connectTo(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'kill.connection',
function(data){
ipc.log('world requested kill.connection'.notice);
ipc.log('world requested kill.connection');
ipc.disconnect('world');
}
);

View File

@ -1,4 +1,4 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
@ -16,7 +16,7 @@ ipc.connectTo(
ipc.of.world.on(
'connect',
function(){
ipc.log('## connected to world ##'.rainbow, ipc.config.delay);
ipc.log('## connected to world ##', ipc.config.delay);
ipc.of.world.emit(
'app.message',
{
@ -29,19 +29,19 @@ ipc.connectTo(
ipc.of.world.on(
'disconnect',
function(){
ipc.log('disconnected from world'.notice);
ipc.log('disconnected from world');
}
);
ipc.of.world.on(
'app.message',
function(data){
ipc.log('got a message from world : '.debug, data);
ipc.log('got a message from world : ', data);
}
);
ipc.of.world.on(
'kill.connection',
function(data){
ipc.log('world requested kill.connection'.notice);
ipc.log('world requested kill.connection');
ipc.disconnect('world');
}
);

View File

@ -1,10 +1,10 @@
var ipc=require('../../../node-ipc');
import ipc from '../../../node-ipc.js';
/***************************************\
*
*
* You should start both hello and world
* then you will see them communicating.
*
*
* *************************************/
ipc.config.id = 'world';
@ -20,7 +20,7 @@ ipc.serve(
ipc.server.on(
'app.message',
function(data,socket){
ipc.log('got a message from'.debug, (data.id).variable, (data.message).data);
ipc.log('got a message from', (data.id), (data.message));
messages[data.id]=true;
ipc.server.emit(
socket,
@ -30,9 +30,9 @@ ipc.serve(
message : data.message+' world!'
}
);
if(messages.hello && messages.goodbye){
ipc.log('got all required events, telling clients to kill connection'.good);
ipc.log('got all required events, telling clients to kill connection');
ipc.server.broadcast(
'kill.connection',
{

Some files were not shown because too many files have changed in this diff Show More