migrating to es6

This commit is contained in:
Brandon Nozaki Miller 2016-01-10 20:59:40 -08:00
parent 6a00244670
commit 143e23ca4d
22 changed files with 4709 additions and 1461 deletions

View file

@ -2,7 +2,7 @@
const net = require('net'),
tls = require('tls'),
eventParser = require('../lib/eventParser.js'),
eventParser = require('./eventParser.js'),
Pubsub = require('event-pubsub'),
Message = require('js-message'),
fs = require('fs'),

View file

@ -4,7 +4,7 @@ const net = require('net'),
tls = require('tls'),
fs = require('fs'),
dgram = require('dgram'),
eventParser = require('../lib/eventParser.js'),
eventParser = require('./eventParser.js'),
Pubsub = require('event-pubsub'),
Message = require('js-message');

93
entities/Defaults.js Normal file
View file

@ -0,0 +1,93 @@
'use strict';
const os = require('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
}
}
);
}
}
module.exports=Defaults;

15
entities/LogColors.js Normal file
View file

@ -0,0 +1,15 @@
'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,319 +1,25 @@
'use strict';
const os = require('os'),
util = require('util'),
colors = require('colors'),
Client = require('./lib/client.js'),
Server = require('./lib/socketServer.js');
const colors = require('colors'),
LogColors = require('./entities/LogColors.js'),
IPC = require('./services/IPC.js');
colors.setTheme(
{
good : 'green',
notice : 'yellow',
warn : 'red',
error : 'redBG',
debug : 'magenta',
variable: 'cyan',
data : 'blue'
class IPCModule extends IPC{
constructor(){
super();
Object.defineProperty(
this,
'IPC',
{
enumerable:true,
writable:false,
value:IPC
}
)
}
);
const IPType=os.networkInterfaces()[
Object.keys(os.networkInterfaces())[0]
][0].family;
let defaults={
appspace : 'app.',
socketRoot : '/tmp/',
networkHost : (IPType=='IPv6')? '::1' : '127.0.0.1',
networkPort : 8000,
id : os.hostname(),
encoding : 'utf8',
rawBuffer : false,
sync : false,
silent : false,
maxConnections : 100,
retry : 500,
maxRetries : Infinity,
stopRetrying : false,
IPType : IPType,
tls : false
};
let ipc = {
config : defaults,
connectTo : connect,
connectToNet: connectNet,
disconnect : disconnect,
serve : serve,
serveNet : serveNet,
of : {},
server : false,
log : log
};
function log(){
if(ipc.config.silent){
return;
}
let args=Array.prototype.slice.call(arguments);
for(let i=0, count=args.length; i<count; i++){
if(typeof args[i] != 'object'){
continue;
}
args[i]=util.inspect(args[i],{colors:true});
}
console.log(
args.join(' ')
);
}
function disconnect(id){
if(!ipc.of[id]){
return;
}
ipc.of[id].config.stopRetrying=true;
colors.setTheme(new LogColors);
ipc.of[id].off('*');
if(ipc.of[id].socket){
if(ipc.of[id].socket.destroy){
ipc.of[id].socket.destroy();
}
}
delete ipc.of[id];
}
function serve(path,callback){
if(typeof path=='function'){
callback=path;
path=false;
}
if(!path){
ipc.log(
'Server path not specified, so defaulting to'.notice,
'ipc.config.socketRoot + ipc.config.appspace + ipc.config.id'.variable,
(ipc.config.socketRoot+ipc.config.appspace+ipc.config.id).data
);
path=ipc.config.socketRoot+ipc.config.appspace+ipc.config.id;
}
if(!callback){
callback=emptyCallback;
}
ipc.server=new Server(
path,
ipc.config,
log
);
ipc.server.on(
'start',
callback
);
}
function emptyCallback(){
//Do Nothing
}
function serveNet(host,port,UDPType,callback){
if(typeof host=='number'){
callback=UDPType;
UDPType=port;
port=host;
host=false;
}
if(typeof host=='function'){
callback=host;
UDPType=false;
host=false;
port=false;
}
if(!host){
ipc.log(
'Server host not specified, so defaulting to'.notice,
'ipc.config.networkHost'.variable,
ipc.config.networkHost.data
);
host=ipc.config.networkHost;
}
if(host.toLowerCase()=='udp4' || host.toLowerCase()=='udp6'){
callback=port;
UDPType=host.toLowerCase();
port=false;
host=ipc.config.networkHost;
}
if(typeof port=='string'){
callback=UDPType;
UDPType=port;
port=false;
}
if(typeof port=='function'){
callback=port;
UDPType=false;
port=false;
}
if(!port){
ipc.log(
'Server port not specified, so defaulting to'.notice,
'ipc.config.networkPort'.variable,
ipc.config.networkPort
);
port=ipc.config.networkPort;
}
if(typeof UDPType=='function'){
callback=UDPType;
UDPType=false;
}
if(!callback){
callback=emptyCallback;
}
ipc.server=new Server(
host,
ipc.config,
log,
port
);
if(UDPType){
ipc.server[UDPType]=true;
}
ipc.server.on(
'start',
callback
);
}
function connect(id,path,callback){
if(typeof path == 'function'){
callback=path;
path=false;
}
if(!callback){
callback=emptyCallback;
}
if(!id){
ipc.log(
'Service id required'.warn,
'Requested service connection without specifying service id. Aborting connection attempt'.notice
);
return;
}
if(!path){
ipc.log(
'Service path not specified, so defaulting to'.notice,
'ipc.config.socketRoot + ipc.config.appspace + id'.variable,
(ipc.config.socketRoot+ipc.config.appspace+id).data
);
path=ipc.config.socketRoot+ipc.config.appspace+id;
}
if(ipc.of[id]){
if(!ipc.of[id].socket.destroyed){
ipc.log(
'Already Connected to'.notice,
id.variable,
'- So executing success without connection'.notice
);
callback();
return;
}
ipc.of[id].socket.destroy();
}
ipc.of[id] = new Client(ipc.config,ipc.log);
ipc.of[id].id = id;
ipc.of[id].path = path;
ipc.of[id].connect();
callback(ipc);
}
function connectNet(id,host,port,callback){
if(!id){
ipc.log(
'Service id required'.warn,
'Requested service connection without specifying service id. Aborting connection attempt'.notice
);
return;
}
if(typeof host=='number'){
callback=port;
port=host;
host=false;
}
if(typeof host=='function'){
callback=host;
host=false;
port=false;
}
if(!host){
ipc.log(
'Server host not specified, so defaulting to'.notice,
'ipc.config.networkHost'.variable,
ipc.config.networkHost.data
);
host=ipc.config.networkHost;
}
if(typeof port=='function'){
callback=port;
port=false;
}
if(!port){
ipc.log(
'Server port not specified, so defaulting to'.notice,
'ipc.config.networkPort'.variable,
ipc.config.networkPort
);
port=ipc.config.networkPort;
}
if(typeof callback == 'string'){
UDPType=callback;
callback=false;
}
if(!callback){
callback=emptyCallback;
}
if(ipc.of[id]){
if(!ipc.of[id].socket.destroyed){
ipc.log(
'Already Connected to'.notice,
id.variable,
'- So executing success without connection'.notice
);
callback();
return;
}
ipc.of[id].socket.destroy();
}
ipc.of[id] = new Client(ipc.config,ipc.log);
ipc.of[id].id = id;
ipc.of[id].path = host;
ipc.of[id].port = port;
ipc.of[id].connect();
callback(ipc);
}
module.exports=ipc;
module.exports=new IPCModule;

View file

@ -23,7 +23,8 @@
},
"scripts": {
"test": "istanbul cover -x **/spec/** -dir ./spec/coverage jasmine",
"cover": "istanbul cover -x **/spec/** -dir ./spec/coverage jasmine&& cat ./spec/coverage/lcov.info | codacy-coverage"
"cover": "istanbul cover -x **/spec/** -dir ./spec/coverage jasmine",
"coverup": "cat ./spec/coverage/lcov.info | codacy-coverage"
},
"keywords": [
"IPC",

328
services/IPC.js Normal file
View file

@ -0,0 +1,328 @@
'use strict';
const Defaults = require('../entities/Defaults.js'),
Client = require('../dao/client.js'),
Server = require('../dao/socketServer.js'),
util = require('util');
class IPC{
constructor(){
Object.defineProperties(
this,
{
config : {
enumerable:true,
writable:true,
value:new Defaults
},
connectTo : {
enumerable:true,
writable:false,
value:connect
},
connectToNet: {
enumerable:true,
writable:false,
value:connectNet
},
disconnect : {
enumerable:true,
writable:false,
value:disconnect
},
serve : {
enumerable:true,
writable:false,
value:serve
},
serveNet : {
enumerable:true,
writable:false,
value:serveNet
},
of : {
enumerable:true,
writable:true,
value:{}
},
server : {
enumerable:true,
writable:true,
configurable:true,
value:false
},
log : {
enumerable:true,
writable:false,
value:log
}
}
);
}
}
function log(){
if(this.config.silent){
return;
}
let args=Array.prototype.slice.call(arguments);
for(let i=0, count=args.length; i<count; i++){
if(typeof args[i] != 'object'){
continue;
}
args[i]=util.inspect(args[i],{colors:true});
}
console.log(
args.join(' ')
);
}
function disconnect(id){
if(!this.of[id]){
return;
}
this.of[id].config.stopRetrying=true;
this.of[id].off('*');
if(this.of[id].socket){
if(this.of[id].socket.destroy){
this.of[id].socket.destroy();
}
}
delete this.of[id];
}
function serve(path,callback){
if(typeof path=='function'){
callback=path;
path=false;
}
if(!path){
this.log(
'Server path not specified, so defaulting to'.notice,
'ipc.config.socketRoot + ipc.config.appspace + ipc.config.id'.variable,
(this.config.socketRoot+this.config.appspace+this.config.id).data
);
path=this.config.socketRoot+this.config.appspace+this.config.id;
}
if(!callback){
callback=emptyCallback;
}
this.server=new Server(
path,
this.config,
log
);
this.server.on(
'start',
callback
);
}
function emptyCallback(){
//Do Nothing
}
function serveNet(host,port,UDPType,callback){
if(typeof host=='number'){
callback=UDPType;
UDPType=port;
port=host;
host=false;
}
if(typeof host=='function'){
callback=host;
UDPType=false;
host=false;
port=false;
}
if(!host){
this.log(
'Server host not specified, so defaulting to'.notice,
'ipc.config.networkHost'.variable,
this.config.networkHost.data
);
host=this.config.networkHost;
}
if(host.toLowerCase()=='udp4' || host.toLowerCase()=='udp6'){
callback=port;
UDPType=host.toLowerCase();
port=false;
host=this.config.networkHost;
}
if(typeof port=='string'){
callback=UDPType;
UDPType=port;
port=false;
}
if(typeof port=='function'){
callback=port;
UDPType=false;
port=false;
}
if(!port){
this.log(
'Server port not specified, so defaulting to'.notice,
'ipc.config.networkPort'.variable,
this.config.networkPort
);
port=this.config.networkPort;
}
if(typeof UDPType=='function'){
callback=UDPType;
UDPType=false;
}
if(!callback){
callback=emptyCallback;
}
this.server=new Server(
host,
this.config,
log,
port
);
if(UDPType){
this.server[UDPType]=true;
}
this.server.on(
'start',
callback
);
}
function connect(id,path,callback){
if(typeof path == 'function'){
callback=path;
path=false;
}
if(!callback){
callback=emptyCallback;
}
if(!id){
this.log(
'Service id required'.warn,
'Requested service connection without specifying service id. Aborting connection attempt'.notice
);
return;
}
if(!path){
this.log(
'Service path not specified, so defaulting to'.notice,
'ipc.config.socketRoot + ipc.config.appspace + id'.variable,
(this.config.socketRoot+this.config.appspace+id).data
);
path=this.config.socketRoot+this.config.appspace+id;
}
if(this.of[id]){
if(!this.of[id].socket.destroyed){
this.log(
'Already Connected to'.notice,
id.variable,
'- So executing success without connection'.notice
);
callback();
return;
}
this.of[id].socket.destroy();
}
this.of[id] = new Client(this.config,this.log);
this.of[id].id = id;
this.of[id].path = path;
this.of[id].connect();
callback(this);
}
function connectNet(id,host,port,callback){
if(!id){
this.log(
'Service id required'.warn,
'Requested service connection without specifying service id. Aborting connection attempt'.notice
);
return;
}
if(typeof host=='number'){
callback=port;
port=host;
host=false;
}
if(typeof host=='function'){
callback=host;
host=false;
port=false;
}
if(!host){
this.log(
'Server host not specified, so defaulting to'.notice,
'ipc.config.networkHost'.variable,
this.config.networkHost.data
);
host=this.config.networkHost;
}
if(typeof port=='function'){
callback=port;
port=false;
}
if(!port){
this.log(
'Server port not specified, so defaulting to'.notice,
'ipc.config.networkPort'.variable,
this.config.networkPort
);
port=this.config.networkPort;
}
if(typeof callback == 'string'){
UDPType=callback;
callback=false;
}
if(!callback){
callback=emptyCallback;
}
if(this.of[id]){
if(!this.of[id].socket.destroyed){
this.log(
'Already Connected to'.notice,
id.variable,
'- So executing success without connection'.notice
);
callback();
return;
}
this.of[id].socket.destroy();
}
this.of[id] = new Client(this.config,this.log);
this.of[id].id = id;
this.of[id].path = host;
this.of[id].port = port;
this.of[id].connect();
callback(this);
}
module.exports=IPC;

File diff suppressed because one or more lines are too long

View file

@ -20,9 +20,9 @@
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">67.49% </span>
<span class="strong">68.59% </span>
<span class="quiet">Statements</span>
<span class='fraction'>272/403</span>
<span class='fraction'>286/417</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">56.37% </span>
@ -30,14 +30,14 @@
<span class='fraction'>115/204</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.84% </span>
<span class="strong">88.1% </span>
<span class="quiet">Functions</span>
<span class='fraction'>33/38</span>
<span class='fraction'>37/42</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">67.49% </span>
<span class="strong">68.59% </span>
<span class="quiet">Lines</span>
<span class='fraction'>272/403</span>
<span class='fraction'>286/417</span>
</div>
</div>
</div>
@ -59,20 +59,20 @@
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="node-ipc/"><a href="node-ipc/index.html">node-ipc/</a></td>
<td data-value="66.91" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 66%;"></div><div class="cover-empty" style="width:34%;"></div></div></td>
<td data-value="66.91" class="pct medium">66.91%</td>
<td data-value="136" class="abs medium">91/136</td>
<td data-value="59.72" class="pct medium">59.72%</td>
<td data-value="72" class="abs medium">43/72</td>
<td data-value="85.71" class="pct high">85.71%</td>
<td data-value="7" class="abs high">6/7</td>
<td data-value="66.91" class="pct medium">66.91%</td>
<td data-value="136" class="abs medium">91/136</td>
<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="5" class="abs high">5/5</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</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="5" class="abs high">5/5</td>
</tr>
<tr>
<td class="file medium" data-value="node-ipc/lib/"><a href="node-ipc/lib/index.html">node-ipc/lib/</a></td>
<td class="file medium" data-value="node-ipc/dao/"><a href="node-ipc/dao/index.html">node-ipc/dao/</a></td>
<td data-value="67.79" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 67%;"></div><div class="cover-empty" style="width:33%;"></div></div></td>
<td data-value="67.79" class="pct medium">67.79%</td>
<td data-value="267" class="abs medium">181/267</td>
@ -84,13 +84,39 @@
<td data-value="267" class="abs medium">181/267</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="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="50" class="pct medium">50%</td>
<td data-value="2" class="abs medium">1/2</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="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="66.17" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 66%;"></div><div class="cover-empty" style="width:34%;"></div></div></td>
<td data-value="66.17" class="pct medium">66.17%</td>
<td data-value="133" class="abs medium">88/133</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="70" class="abs medium">42/70</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="8" class="abs high">7/8</td>
<td data-value="66.17" class="pct medium">66.17%</td>
<td data-value="133" class="abs medium">88/133</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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 05:12:07 GMT-0800 (PST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="prettify.js"></script>

View file

@ -0,0 +1,773 @@
<!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" />
<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">72.82% </span>
<span class="quiet">Statements</span>
<span class='fraction'>75/103</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">52.38% </span>
<span class="quiet">Branches</span>
<span class='fraction'>22/42</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>10/10</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">72.82% </span>
<span class="quiet">Lines</span>
<span class='fraction'>75/103</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&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-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&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-neutral">&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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-yes">10×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
&nbsp;
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');
&nbsp;
function init(config,log){
let client={
config : config,
queue : new Queue,
socket : false,
connect : connect,
emit : emit,
log : log,
retriesRemaining:config.maxRetries||<span class="branch-1 cbranch-no" title="branch not covered" >0</span>
};
&nbsp;
new Pubsub(client);
&nbsp;
return client;
}
&nbsp;
function emit(type,data){
this.log('dispatching event to '.debug, this.id.variable, this.path.variable,' : ', type.data,',', data);
&nbsp;
let message=new Message;
message.type=type;
message.data=data;
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(this.config.rawBuffer){
<span class="cstat-no" title="statement not covered" > message=new Buffer(type,this.encoding);</span>
}else{
message=eventParser.format(message);
}
&nbsp;
if(!this.config.sync){
this.socket.write(message);
return;
}
&nbsp;
this.queue.add(
syncEmit.bind(this,message)
);
}
&nbsp;
function syncEmit(message){
this.log('dispatching event to '.debug, this.id.variable, this.path.variable,' : ', message.data);
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 '.debug, client.id.variable, client.path.variable);
<span class="missing-if-branch" title="if path not taken" >I</span>if(!this.path){
<span class="cstat-no" title="statement not covered" > client.log('\n\n######\nerror: '.error, client.id .info,' client has not specified socket path it wishes to connect to.'.error);</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
if(!client.port){
client.log('Connecting client on Unix Socket :'.debug, client.path.variable);
&nbsp;
let path = client.path;
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if (process.platform ==='win32' &amp;&amp; <span class="branch-1 cbranch-no" title="branch not covered" >!client.path.startsWith('\\\\.\\pipe\\'))</span>{
<span class="cstat-no" title="statement not covered" > path = path.replace(/^\//, '');</span>
<span class="cstat-no" title="statement not covered" > path = path.replace(/\//g, '-');</span>
<span class="cstat-no" title="statement not covered" > path= '\\\\.\\pipe\\'+path;</span>
}
client.socket = net.connect(
{
path: path
}
);
}else{
<span class="missing-if-branch" title="else path not taken" >E</span>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
}
);
}else{
<span class="cstat-no" title="statement not covered" > client.log('Connecting client via TLS to'.debug, client.path.variable ,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" > 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" > 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" > 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>
fs.readFileSync(client.config.tls.trustedConnections[i])
);
}
}
&nbsp;
<span class="cstat-no" title="statement not covered" > client.config.tls.host=client.path;</span>
<span class="cstat-no" title="statement not covered" > client.config.tls.port=client.port;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" > client.socket = tls.connect(</span>
client.config.tls
);
}
}
&nbsp;
client.socket.setEncoding(this.config.encoding);
&nbsp;
client.socket.on(
'error',
function(err){
client.log('\n\n######\nerror: '.error, err);
client.trigger('error', err);
&nbsp;
}
);
&nbsp;
client.socket.on(
'connect',
function connectionMade(){
client.trigger('connect');
client.retriesRemaining=client.config.maxRetries;
client.log('retrying reset');
}
);
&nbsp;
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);
&nbsp;
if(
client.config.stopRetrying || client.retriesRemaining&lt;1
&nbsp;
){
client.trigger('disconnect');
client.log(
client.config.id.variable,
'exceeded connection rety amount of'.warn,
' or stopRetrying flag set.'
);
&nbsp;
client.socket.destroy();
client.trigger('destroy');
client=undefined;
&nbsp;
return;
}
&nbsp;
client.isRetrying=true;
&nbsp;
setTimeout(
function retryTimeout(){
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
);
&nbsp;
client.trigger('disconnect');
}
);
&nbsp;
client.socket.on(
'data',
function(data) {
client.log('## recieved events ##'.rainbow);
<span class="missing-if-branch" title="if path not taken" >I</span>if(client.config.rawBuffer){
<span class="cstat-no" title="statement not covered" > client.trigger(</span>
'data',
new Buffer(data,this.encoding)
);
<span class="cstat-no" title="statement not covered" > if(!client.config.sync){</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
<span class="cstat-no" title="statement not covered" > client.queue.next();</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
<span class="missing-if-branch" title="else path not taken" >E</span>if(!this.ipcBuffer){
this.ipcBuffer='';
}
&nbsp;
data=(this.ipcBuffer+=data);
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(data.slice(-1)!=eventParser.delimiter || data.indexOf(eventParser.delimiter) == -1){
<span class="cstat-no" title="statement not covered" > client.log('Implementing larger buffer for this socket message. You may want to consider smaller messages'.notice);</span>
<span class="cstat-no" title="statement not covered" > return;</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 of type '.debug, message.type.data, message.data);
client.trigger(
message.type,
message.data
);
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(!client.config.sync){
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
client.queue.next();
}
);
}
&nbsp;
module.exports=init;
&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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View file

@ -0,0 +1,146 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/dao/eventParser.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<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> eventParser.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">84.62% </span>
<span class="quiet">Statements</span>
<span class='fraction'>11/13</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class='fraction'>2/4</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">84.62% </span>
<span class="quiet">Lines</span>
<span class='fraction'>11/13</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-yes">9×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
&nbsp;
const parser={
parse : parseDataEvents,
format : formatData,
delimiter : '\f'
};
&nbsp;
function formatData(message){
<span class="missing-if-branch" title="if path not taken" >I</span>if(!message.data){
<span class="cstat-no" title="statement not covered" > message.data={};</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if(message.data['_maxListeners']){
<span class="cstat-no" title="statement not covered" > message.data={};</span>
}
&nbsp;
message=message.JSON+parser.delimiter;
return message;
}
&nbsp;
function parseDataEvents(data){
let events=data.split(parser.delimiter);
events.pop();
return events;
}
&nbsp;
module.exports=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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View file

@ -0,0 +1,119 @@
<!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" />
<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">67.79% </span>
<span class="quiet">Statements</span>
<span class='fraction'>181/267</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">54.55% </span>
<span class="quiet">Branches</span>
<span class='fraction'>72/132</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">87.1% </span>
<span class="quiet">Functions</span>
<span class='fraction'>27/31</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">67.79% </span>
<span class="quiet">Lines</span>
<span class='fraction'>181/267</span>
</div>
</div>
</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="72.82" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 72%;"></div><div class="cover-empty" style="width:28%;"></div></div></td>
<td data-value="72.82" class="pct medium">72.82%</td>
<td data-value="103" class="abs medium">75/103</td>
<td data-value="52.38" class="pct medium">52.38%</td>
<td data-value="42" class="abs medium">22/42</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="10" class="abs high">10/10</td>
<td data-value="72.82" class="pct medium">72.82%</td>
<td data-value="103" class="abs medium">75/103</td>
</tr>
<tr>
<td class="file high" data-value="eventParser.js"><a href="eventParser.js.html">eventParser.js</a></td>
<td data-value="84.62" class="pic high"><div class="chart"><div class="cover-fill" style="width: 84%;"></div><div class="cover-empty" style="width:16%;"></div></div></td>
<td data-value="84.62" class="pct high">84.62%</td>
<td data-value="13" class="abs high">11/13</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="4" class="abs medium">2/4</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="2" class="abs high">2/2</td>
<td data-value="84.62" class="pct high">84.62%</td>
<td data-value="13" class="abs high">11/13</td>
</tr>
<tr>
<td class="file medium" data-value="socketServer.js"><a href="socketServer.js.html">socketServer.js</a></td>
<td data-value="62.91" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 62%;"></div><div class="cover-empty" style="width:38%;"></div></div></td>
<td data-value="62.91" class="pct medium">62.91%</td>
<td data-value="151" class="abs medium">95/151</td>
<td data-value="55.81" class="pct medium">55.81%</td>
<td data-value="86" class="abs medium">48/86</td>
<td data-value="78.95" class="pct medium">78.95%</td>
<td data-value="19" class="abs medium">15/19</td>
<td data-value="62.91" class="pct medium">62.91%</td>
<td data-value="151" class="abs medium">95/151</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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,344 @@
<!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" />
<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">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class='fraction'>1/2</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'>4/4</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
const os = require('os');
&nbsp;
class Defaults{
constructor(){
const IPType=os.networkInterfaces()[
Object.keys(os.networkInterfaces())[0]
][0].family;
&nbsp;
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')? <span class="branch-0 cbranch-no" title="branch not covered" >'::1' </span>: '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
}
}
);
}
}
&nbsp;
module.exports=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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View file

@ -0,0 +1,110 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for node-ipc/entities/LogColors.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../../prettify.css" />
<link rel="stylesheet" href="../../base.css" />
<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> LogColors.js
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>8/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</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'>8/8</span>
</div>
</div>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
&nbsp;
class LogColors{
constructor(){
this.good='green';
this.notice='yellow';
this.warn='red';
this.error='redBG';
this.debug='magenta';
this.variable='cyan';
this.data='blue';
}
}
&nbsp;
module.exports=LogColors;
&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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View file

@ -0,0 +1,106 @@
<!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" />
<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">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>12/12</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">50% </span>
<span class="quiet">Branches</span>
<span class='fraction'>1/2</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'>12/12</span>
</div>
</div>
</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="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="4" class="abs high">4/4</td>
<td data-value="50" class="pct medium">50%</td>
<td data-value="2" class="abs medium">1/2</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="4" class="abs high">4/4</td>
</tr>
<tr>
<td class="file high" data-value="LogColors.js"><a href="LogColors.js.html">LogColors.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="8" class="abs high">8/8</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</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="8" class="abs high">8/8</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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View file

@ -20,28 +20,28 @@
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">66.91% </span>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>91/136</span>
<span class='fraction'>5/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">59.72% </span>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>43/72</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">85.71% </span>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/7</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.91% </span>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>91/136</span>
<span class='fraction'>5/5</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<div class='status-line high'></div>
<div class="pad1">
<table class="coverage-summary">
<thead>
@ -59,16 +59,16 @@
</tr>
</thead>
<tbody><tr>
<td class="file medium" data-value="node-ipc.js"><a href="node-ipc.js.html">node-ipc.js</a></td>
<td data-value="66.91" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 66%;"></div><div class="cover-empty" style="width:34%;"></div></div></td>
<td data-value="66.91" class="pct medium">66.91%</td>
<td data-value="136" class="abs medium">91/136</td>
<td data-value="59.72" class="pct medium">59.72%</td>
<td data-value="72" class="abs medium">43/72</td>
<td data-value="85.71" class="pct high">85.71%</td>
<td data-value="7" class="abs high">6/7</td>
<td data-value="66.91" class="pct medium">66.91%</td>
<td data-value="136" class="abs medium">91/136</td>
<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="5" class="abs high">5/5</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="0" class="abs high">0/0</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="5" class="abs high">5/5</td>
</tr>
</tbody>
@ -77,7 +77,7 @@
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 05:12:07 GMT-0800 (PST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../prettify.js"></script>

View file

@ -20,28 +20,28 @@
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">66.91% </span>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>91/136</span>
<span class='fraction'>5/5</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">59.72% </span>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>43/72</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">85.71% </span>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>6/7</span>
<span class='fraction'>1/1</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.91% </span>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>91/136</span>
<span class='fraction'>5/5</span>
</div>
</div>
</div>
<div class='status-line medium'></div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
@ -68,301 +68,7 @@
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
26</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
@ -371,21 +77,6 @@
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
@ -399,614 +90,41 @@
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">114×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">114×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">114×</span>
<span class="cline-any cline-yes">346×</span>
<span class="cline-any cline-yes">318×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">28×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">114×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">7×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</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-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</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-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
&nbsp;
const os = require('os'),
util = require('util'),
colors = require('colors'),
Client = require('./lib/client.js'),
Server = require('./lib/socketServer.js');
const colors = require('colors'),
LogColors = require('./entities/LogColors.js'),
IPC = require('./services/IPC.js');
&nbsp;
colors.setTheme(
{
good : 'green',
notice : 'yellow',
warn : 'red',
error : 'redBG',
debug : 'magenta',
variable: 'cyan',
data : 'blue'
class IPCModule extends IPC{
constructor(){
super();
Object.defineProperty(
this,
'IPC',
{
enumerable:true,
writable:false,
value:IPC
}
)
}
);
&nbsp;
const IPType=os.networkInterfaces()[
Object.keys(os.networkInterfaces())[0]
][0].family;
&nbsp;
let defaults={
appspace : 'app.',
socketRoot : '/tmp/',
networkHost : (IPType=='IPv6')? <span class="branch-0 cbranch-no" title="branch not covered" >'::1' </span>: '127.0.0.1',
networkPort : 8000,
id : os.hostname(),
encoding : 'utf8',
rawBuffer : false,
sync : false,
silent : false,
maxConnections : 100,
retry : 500,
maxRetries : Infinity,
stopRetrying : false,
IPType : IPType,
tls : false
};
&nbsp;
let ipc = {
config : defaults,
connectTo : connect,
connectToNet: connectNet,
disconnect : disconnect,
serve : serve,
serveNet : serveNet,
of : {},
server : false,
log : log
};
&nbsp;
function log(){
<span class="missing-if-branch" title="if path not taken" >I</span>if(ipc.config.silent){
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
let args=Array.prototype.slice.call(arguments);
&nbsp;
for(let i=0, count=args.length; i&lt;count; i++){
if(typeof args[i] != 'object'){
continue;
}
&nbsp;
args[i]=util.inspect(args[i],{colors:true});
}
&nbsp;
console.log(
args.join(' ')
);
}
&nbsp;
function disconnect(id){
<span class="missing-if-branch" title="if path not taken" >I</span>if(!ipc.of[id]){
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
ipc.of[id].config.stopRetrying=true;
colors.setTheme(new LogColors);
&nbsp;
ipc.of[id].off('*');
<span class="missing-if-branch" title="else path not taken" >E</span>if(ipc.of[id].socket){
<span class="missing-if-branch" title="else path not taken" >E</span>if(ipc.of[id].socket.destroy){
ipc.of[id].socket.destroy();
}
}
&nbsp;
delete ipc.of[id];
}
&nbsp;
function serve(path,callback){
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof path=='function'){
<span class="cstat-no" title="statement not covered" > callback=path;</span>
<span class="cstat-no" title="statement not covered" > path=false;</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if(!path){
<span class="cstat-no" title="statement not covered" > ipc.log(</span>
'Server path not specified, so defaulting to'.notice,
'ipc.config.socketRoot + ipc.config.appspace + ipc.config.id'.variable,
(ipc.config.socketRoot+ipc.config.appspace+ipc.config.id).data
);
<span class="cstat-no" title="statement not covered" > path=ipc.config.socketRoot+ipc.config.appspace+ipc.config.id;</span>
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(!callback){
<span class="cstat-no" title="statement not covered" > callback=emptyCallback;</span>
}
&nbsp;
ipc.server=new Server(
path,
ipc.config,
log
);
&nbsp;
ipc.server.on(
'start',
callback
);
}
&nbsp;
<span class="fstat-no" title="function not covered" >function emptyCallback(){</span>
//Do Nothing
}
&nbsp;
function serveNet(host,port,UDPType,callback){
if(typeof host=='number'){
callback=UDPType;
UDPType=port;
port=host;
host=false;
}
if(typeof host=='function'){
callback=host;
UDPType=false;
host=false;
port=false;
}
if(!host){
ipc.log(
'Server host not specified, so defaulting to'.notice,
'ipc.config.networkHost'.variable,
ipc.config.networkHost.data
);
host=ipc.config.networkHost;
}
<span class="missing-if-branch" title="if path not taken" >I</span>if(host.toLowerCase()=='udp4' || host.toLowerCase()=='udp6'){
<span class="cstat-no" title="statement not covered" > callback=port;</span>
<span class="cstat-no" title="statement not covered" > UDPType=host.toLowerCase();</span>
<span class="cstat-no" title="statement not covered" > port=false;</span>
<span class="cstat-no" title="statement not covered" > host=ipc.config.networkHost;</span>
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof port=='string'){
<span class="cstat-no" title="statement not covered" > callback=UDPType;</span>
<span class="cstat-no" title="statement not covered" > UDPType=port;</span>
<span class="cstat-no" title="statement not covered" > port=false;</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof port=='function'){
<span class="cstat-no" title="statement not covered" > callback=port;</span>
<span class="cstat-no" title="statement not covered" > UDPType=false;</span>
<span class="cstat-no" title="statement not covered" > port=false;</span>
}
if(!port){
ipc.log(
'Server port not specified, so defaulting to'.notice,
'ipc.config.networkPort'.variable,
ipc.config.networkPort
);
port=ipc.config.networkPort;
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof UDPType=='function'){
<span class="cstat-no" title="statement not covered" > callback=UDPType;</span>
<span class="cstat-no" title="statement not covered" > UDPType=false;</span>
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(!callback){
<span class="cstat-no" title="statement not covered" > callback=emptyCallback;</span>
}
&nbsp;
ipc.server=new Server(
host,
ipc.config,
log,
port
);
&nbsp;
if(UDPType){
ipc.server[UDPType]=true;
}
&nbsp;
ipc.server.on(
'start',
callback
);
}
&nbsp;
function connect(id,path,callback){
if(typeof path == 'function'){
callback=path;
path=false;
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(!callback){
<span class="cstat-no" title="statement not covered" > callback=emptyCallback;</span>
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(!id){
<span class="cstat-no" title="statement not covered" > ipc.log(</span>
'Service id required'.warn,
'Requested service connection without specifying service id. Aborting connection attempt'.notice
);
<span class="cstat-no" title="statement not covered" > return;</span>
}
&nbsp;
if(!path){
ipc.log(
'Service path not specified, so defaulting to'.notice,
'ipc.config.socketRoot + ipc.config.appspace + id'.variable,
(ipc.config.socketRoot+ipc.config.appspace+id).data
);
path=ipc.config.socketRoot+ipc.config.appspace+id;
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(ipc.of[id]){
<span class="cstat-no" title="statement not covered" > if(!ipc.of[id].socket.destroyed){</span>
<span class="cstat-no" title="statement not covered" > ipc.log(</span>
'Already Connected to'.notice,
id.variable,
'- So executing success without connection'.notice
);
<span class="cstat-no" title="statement not covered" > callback();</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
<span class="cstat-no" title="statement not covered" > ipc.of[id].socket.destroy();</span>
}
&nbsp;
ipc.of[id] = new Client(ipc.config,ipc.log);
ipc.of[id].id = id;
ipc.of[id].path = path;
&nbsp;
ipc.of[id].connect();
&nbsp;
callback(ipc);
}
&nbsp;
function connectNet(id,host,port,callback){
<span class="missing-if-branch" title="if path not taken" >I</span>if(!id){
<span class="cstat-no" title="statement not covered" > ipc.log(</span>
'Service id required'.warn,
'Requested service connection without specifying service id. Aborting connection attempt'.notice
);
<span class="cstat-no" title="statement not covered" > return;</span>
}
<span class="missing-if-branch" title="else path not taken" >E</span>if(typeof host=='number'){
callback=port;
port=host;
host=false;
}
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof host=='function'){
<span class="cstat-no" title="statement not covered" > callback=host;</span>
<span class="cstat-no" title="statement not covered" > host=false;</span>
<span class="cstat-no" title="statement not covered" > port=false;</span>
}
<span class="missing-if-branch" title="else path not taken" >E</span>if(!host){
ipc.log(
'Server host not specified, so defaulting to'.notice,
'ipc.config.networkHost'.variable,
ipc.config.networkHost.data
);
host=ipc.config.networkHost;
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof port=='function'){
<span class="cstat-no" title="statement not covered" > callback=port;</span>
<span class="cstat-no" title="statement not covered" > port=false;</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if(!port){
<span class="cstat-no" title="statement not covered" > ipc.log(</span>
'Server port not specified, so defaulting to'.notice,
'ipc.config.networkPort'.variable,
ipc.config.networkPort
);
<span class="cstat-no" title="statement not covered" > port=ipc.config.networkPort;</span>
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(typeof callback == 'string'){
<span class="cstat-no" title="statement not covered" > UDPType=callback;</span>
<span class="cstat-no" title="statement not covered" > callback=false;</span>
}
<span class="missing-if-branch" title="if path not taken" >I</span>if(!callback){
<span class="cstat-no" title="statement not covered" > callback=emptyCallback;</span>
}
&nbsp;
<span class="missing-if-branch" title="if path not taken" >I</span>if(ipc.of[id]){
<span class="cstat-no" title="statement not covered" > if(!ipc.of[id].socket.destroyed){</span>
<span class="cstat-no" title="statement not covered" > ipc.log(</span>
'Already Connected to'.notice,
id.variable,
'- So executing success without connection'.notice
);
<span class="cstat-no" title="statement not covered" > callback();</span>
<span class="cstat-no" title="statement not covered" > return;</span>
}
<span class="cstat-no" title="statement not covered" > ipc.of[id].socket.destroy();</span>
}
&nbsp;
ipc.of[id] = new Client(ipc.config,ipc.log);
ipc.of[id].id = id;
ipc.of[id].path = host;
ipc.of[id].port = port;
&nbsp;
ipc.of[id].connect();
&nbsp;
callback(ipc);
}
&nbsp;
module.exports=ipc;
module.exports=new 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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 05:12:07 GMT-0800 (PST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../prettify.js"></script>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,93 @@
<!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" />
<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">66.17% </span>
<span class="quiet">Statements</span>
<span class='fraction'>88/133</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">60% </span>
<span class="quiet">Branches</span>
<span class='fraction'>42/70</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">87.5% </span>
<span class="quiet">Functions</span>
<span class='fraction'>7/8</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">66.17% </span>
<span class="quiet">Lines</span>
<span class='fraction'>88/133</span>
</div>
</div>
</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="66.17" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 66%;"></div><div class="cover-empty" style="width:34%;"></div></div></td>
<td data-value="66.17" class="pct medium">66.17%</td>
<td data-value="133" class="abs medium">88/133</td>
<td data-value="60" class="pct medium">60%</td>
<td data-value="70" class="abs medium">42/70</td>
<td data-value="87.5" class="pct high">87.5%</td>
<td data-value="8" class="abs high">7/8</td>
<td data-value="66.17" class="pct medium">66.17%</td>
<td data-value="133" class="abs medium">88/133</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="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Jan 10 2016 20:57:31 GMT-0800 (PST)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
if (typeof prettyPrint === 'function') {
prettyPrint();
}
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>

View file

@ -1,14 +1,51 @@
TN:
SF:/home/bmiller/git/node-ipc/node-ipc.js
FN:55,log
FN:75,disconnect
FN:92,serve
FN:122,emptyCallback
FN:126,serveNet
FN:199,connect
FN:248,connectNet
FNF:7
FNH:6
FN:8,(anonymous_1)
FNF:1
FNH:1
FNDA:1,(anonymous_1)
DA:3,1
DA:9,1
DA:10,1
DA:23,1
DA:25,1
LF:5
LH:5
BRF:0
BRH:0
end_of_record
TN:
SF:/home/bmiller/git/node-ipc/entities/LogColors.js
FN:4,(anonymous_1)
FNF:1
FNH:1
FNDA:1,(anonymous_1)
DA:5,1
DA:6,1
DA:7,1
DA:8,1
DA:9,1
DA:10,1
DA:11,1
DA:15,1
LF:8
LH:8
BRF:0
BRH:0
end_of_record
TN:
SF:/home/bmiller/git/node-ipc/services/IPC.js
FN:9,(anonymous_1)
FN:64,log
FN:84,disconnect
FN:101,serve
FN:131,emptyCallback
FN:135,serveNet
FN:208,connect
FN:257,connectNet
FNF:8
FNH:7
FNDA:1,(anonymous_1)
FNDA:114,log
FNDA:7,disconnect
FNDA:1,serve
@ -17,220 +54,232 @@ FNDA:3,serveNet
FNDA:4,connect
FNDA:3,connectNet
DA:3,1
DA:9,1
DA:21,1
DA:25,1
DA:43,1
DA:55,1
DA:56,114
DA:57,0
DA:60,114
DA:62,114
DA:63,346
DA:64,318
DA:67,28
DA:70,114
DA:75,1
DA:76,7
DA:77,0
DA:80,7
DA:82,7
DA:83,7
DA:84,7
DA:10,1
DA:64,1
DA:65,114
DA:66,0
DA:69,114
DA:71,114
DA:72,346
DA:73,318
DA:76,28
DA:79,114
DA:84,1
DA:85,7
DA:86,0
DA:89,7
DA:92,1
DA:93,1
DA:94,0
DA:95,0
DA:97,1
DA:98,0
DA:91,7
DA:92,7
DA:93,7
DA:94,7
DA:98,7
DA:101,1
DA:102,1
DA:103,0
DA:104,0
DA:106,1
DA:107,0
DA:110,1
DA:116,1
DA:122,1
DA:126,1
DA:127,3
DA:128,1
DA:129,1
DA:130,1
DA:112,0
DA:115,1
DA:116,0
DA:119,1
DA:125,1
DA:131,1
DA:133,3
DA:134,1
DA:135,1
DA:136,1
DA:136,3
DA:137,1
DA:139,3
DA:140,2
DA:145,2
DA:147,3
DA:148,0
DA:149,0
DA:150,0
DA:151,0
DA:154,3
DA:155,0
DA:156,0
DA:138,1
DA:139,1
DA:140,1
DA:142,3
DA:143,1
DA:144,1
DA:145,1
DA:146,1
DA:148,3
DA:149,2
DA:154,2
DA:156,3
DA:157,0
DA:159,3
DA:158,0
DA:159,0
DA:160,0
DA:161,0
DA:162,0
DA:164,3
DA:165,1
DA:170,1
DA:163,3
DA:164,0
DA:165,0
DA:166,0
DA:168,3
DA:169,0
DA:170,0
DA:171,0
DA:173,3
DA:174,0
DA:175,0
DA:178,3
DA:179,0
DA:174,1
DA:179,1
DA:182,3
DA:189,3
DA:190,2
DA:193,3
DA:199,1
DA:200,4
DA:201,2
DA:202,2
DA:205,4
DA:206,0
DA:183,0
DA:184,0
DA:187,3
DA:188,0
DA:191,3
DA:198,3
DA:199,2
DA:202,3
DA:208,1
DA:209,4
DA:210,0
DA:214,0
DA:217,4
DA:218,2
DA:223,2
DA:210,2
DA:211,2
DA:214,4
DA:215,0
DA:218,4
DA:219,0
DA:223,0
DA:226,4
DA:227,0
DA:228,0
DA:233,0
DA:234,0
DA:227,2
DA:232,2
DA:235,4
DA:236,0
DA:239,4
DA:240,4
DA:241,4
DA:243,4
DA:245,4
DA:248,1
DA:249,3
DA:250,0
DA:254,0
DA:256,3
DA:257,3
DA:237,0
DA:242,0
DA:243,0
DA:245,0
DA:248,4
DA:249,4
DA:250,4
DA:252,4
DA:254,4
DA:257,1
DA:258,3
DA:259,3
DA:261,3
DA:262,0
DA:259,0
DA:263,0
DA:264,0
DA:265,3
DA:266,3
DA:267,3
DA:272,3
DA:268,3
DA:270,3
DA:271,0
DA:272,0
DA:273,0
DA:275,3
DA:276,0
DA:277,0
DA:279,3
DA:280,0
DA:276,3
DA:281,3
DA:284,3
DA:285,0
DA:286,0
DA:288,3
DA:289,0
DA:290,0
DA:292,3
DA:293,0
DA:296,3
DA:297,0
DA:294,0
DA:297,3
DA:298,0
DA:303,0
DA:304,0
DA:299,0
DA:301,3
DA:302,0
DA:305,3
DA:306,0
DA:309,3
DA:310,3
DA:311,3
DA:312,3
DA:314,3
DA:316,3
DA:319,1
LF:136
LH:91
BRDA:28,1,0,0
BRDA:28,1,1,1
BRDA:56,2,0,0
BRDA:56,2,1,114
BRDA:63,3,0,318
BRDA:63,3,1,28
BRDA:76,4,0,0
BRDA:76,4,1,7
BRDA:83,5,0,7
BRDA:83,5,1,0
BRDA:84,6,0,7
BRDA:84,6,1,0
BRDA:93,7,0,0
BRDA:93,7,1,1
BRDA:97,8,0,0
BRDA:97,8,1,1
BRDA:106,9,0,0
BRDA:106,9,1,1
BRDA:127,10,0,1
BRDA:127,10,1,2
BRDA:133,11,0,1
BRDA:133,11,1,2
BRDA:139,12,0,2
BRDA:139,12,1,1
BRDA:147,13,0,0
BRDA:147,13,1,3
BRDA:147,14,0,3
BRDA:147,14,1,3
BRDA:154,15,0,0
BRDA:154,15,1,3
BRDA:159,16,0,0
BRDA:159,16,1,3
BRDA:164,17,0,1
BRDA:164,17,1,2
BRDA:173,18,0,0
BRDA:173,18,1,3
BRDA:178,19,0,0
BRDA:178,19,1,3
BRDA:189,20,0,2
BRDA:189,20,1,1
BRDA:200,21,0,2
BRDA:200,21,1,2
BRDA:205,22,0,0
BRDA:205,22,1,4
BRDA:209,23,0,0
BRDA:209,23,1,4
BRDA:217,24,0,2
BRDA:217,24,1,2
BRDA:226,25,0,0
BRDA:226,25,1,4
BRDA:227,26,0,0
BRDA:227,26,1,0
BRDA:249,27,0,0
BRDA:249,27,1,3
BRDA:256,28,0,3
BRDA:256,28,1,0
BRDA:261,29,0,0
BRDA:261,29,1,3
BRDA:266,30,0,3
BRDA:266,30,1,0
BRDA:275,31,0,0
BRDA:275,31,1,3
BRDA:279,32,0,0
BRDA:279,32,1,3
BRDA:288,33,0,0
BRDA:288,33,1,3
BRDA:292,34,0,0
BRDA:292,34,1,3
BRDA:296,35,0,0
BRDA:296,35,1,3
BRDA:297,36,0,0
BRDA:297,36,1,0
BRF:72
BRH:43
DA:307,0
DA:312,0
DA:313,0
DA:315,0
DA:318,3
DA:319,3
DA:320,3
DA:321,3
DA:323,3
DA:325,3
DA:328,1
LF:133
LH:88
BRDA:65,1,0,0
BRDA:65,1,1,114
BRDA:72,2,0,318
BRDA:72,2,1,28
BRDA:85,3,0,0
BRDA:85,3,1,7
BRDA:92,4,0,7
BRDA:92,4,1,0
BRDA:93,5,0,7
BRDA:93,5,1,0
BRDA:102,6,0,0
BRDA:102,6,1,1
BRDA:106,7,0,0
BRDA:106,7,1,1
BRDA:115,8,0,0
BRDA:115,8,1,1
BRDA:136,9,0,1
BRDA:136,9,1,2
BRDA:142,10,0,1
BRDA:142,10,1,2
BRDA:148,11,0,2
BRDA:148,11,1,1
BRDA:156,12,0,0
BRDA:156,12,1,3
BRDA:156,13,0,3
BRDA:156,13,1,3
BRDA:163,14,0,0
BRDA:163,14,1,3
BRDA:168,15,0,0
BRDA:168,15,1,3
BRDA:173,16,0,1
BRDA:173,16,1,2
BRDA:182,17,0,0
BRDA:182,17,1,3
BRDA:187,18,0,0
BRDA:187,18,1,3
BRDA:198,19,0,2
BRDA:198,19,1,1
BRDA:209,20,0,2
BRDA:209,20,1,2
BRDA:214,21,0,0
BRDA:214,21,1,4
BRDA:218,22,0,0
BRDA:218,22,1,4
BRDA:226,23,0,2
BRDA:226,23,1,2
BRDA:235,24,0,0
BRDA:235,24,1,4
BRDA:236,25,0,0
BRDA:236,25,1,0
BRDA:258,26,0,0
BRDA:258,26,1,3
BRDA:265,27,0,3
BRDA:265,27,1,0
BRDA:270,28,0,0
BRDA:270,28,1,3
BRDA:275,29,0,3
BRDA:275,29,1,0
BRDA:284,30,0,0
BRDA:284,30,1,3
BRDA:288,31,0,0
BRDA:288,31,1,3
BRDA:297,32,0,0
BRDA:297,32,1,3
BRDA:301,33,0,0
BRDA:301,33,1,3
BRDA:305,34,0,0
BRDA:305,34,1,3
BRDA:306,35,0,0
BRDA:306,35,1,0
BRF:70
BRH:42
end_of_record
TN:
SF:/home/bmiller/git/node-ipc/lib/client.js
SF:/home/bmiller/git/node-ipc/entities/Defaults.js
FN:5,(anonymous_1)
FNF:1
FNH:1
FNDA:1,(anonymous_1)
DA:2,1
DA:6,1
DA:10,1
DA:93,1
LF:4
LH:4
BRDA:26,1,0,0
BRDA:26,1,1,1
BRF:2
BRH:1
end_of_record
TN:
SF:/home/bmiller/git/node-ipc/dao/client.js
FN:11,init
FN:27,emit
FN:50,syncEmit
@ -404,7 +453,7 @@ BRF:42
BRH:22
end_of_record
TN:
SF:/home/bmiller/git/node-ipc/lib/eventParser.js
SF:/home/bmiller/git/node-ipc/dao/eventParser.js
FN:9,formatData
FN:21,parseDataEvents
FNF:2
@ -434,7 +483,7 @@ BRF:4
BRH:2
end_of_record
TN:
SF:/home/bmiller/git/node-ipc/lib/socketServer.js
SF:/home/bmiller/git/node-ipc/dao/socketServer.js
FN:11,emit
FN:42,broadcast
FN:65,init