New:Socket for Asana Is Now Available.Learn more
Sign In

node-ipc

Package Overview
Dependencies
Maintainers
12
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ipc - npm Package Compare versions

Package version was removed
This package version has been unpublished, mostly likely due to security reasons
Comparing version
9.1.5
to
9.1.6
+12
helpers/delay.js
async function delay(ms=100) {
return new Promise(
resolve => {
setTimeout(resolve, ms);
}
);
}
export {
delay as default,
delay
}
import lcov2badge from 'lcov2badge';
import {writeFileSync} from 'fs';
lcov2badge.badge(
'./coverage/lcov.info',
function(err, svgBadge){
if (err) throw err;
writeFileSync('./coverage/lcov.svg', svgBadge);
}
);

Sorry, the diff of this file is too big to display

+1
-1

@@ -1,1 +0,1 @@

spec/**/* linguist-generated=true
coverage/**/* linguist-generated=true
# These are supported funding model platforms
github: RIAEvangelist

@@ -23,3 +23,2 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node

node_version:
- 12.x
- 14.x

@@ -26,0 +25,0 @@ - 16.x

@@ -1,11 +0,9 @@

'use strict';
import net from 'net';
import tls from 'tls';
import EventParser from '../entities/EventParser.js';
import Message from 'js-message';
import fs from 'fs';
import Queue from 'js-queue';
import Events from 'event-pubsub';
const net = require('net'),
tls = require('tls'),
EventParser = require('../entities/EventParser.js'),
Message = require('js-message'),
fs = require('fs'),
Queue = require('js-queue'),
Events = require('event-pubsub');
let eventParser = new EventParser();

@@ -16,19 +14,18 @@

super();
Object.assign(
this,
{
Client : Client,
config : config,
queue : new Queue,
socket : false,
connect : connect,
emit : emit,
log : log,
retriesRemaining:config.maxRetries||0,
explicitlyDisconnected: false
}
);
this.config=config;
this.log=log;
this.publish=super.emit;
(config.maxRetries)? this.retriesRemaining=config.maxRetries:0;
eventParser=new EventParser(this.config);
}
Client=Client;
queue =new Queue;
socket=false;
connect=connect;
emit=emit;
retriesRemaining=0;
explicitlyDisconnected=false;
}

@@ -49,2 +46,3 @@

//volitile emit
if(!this.config.sync){

@@ -55,2 +53,3 @@ this.socket.write(message);

//sync, non-volitile, ack emit
this.queue.add(

@@ -259,2 +258,5 @@ syncEmit.bind(this,message)

module.exports=Client;
export {
Client as default,
Client
};

@@ -1,10 +0,9 @@

'use strict';
const net = require('net'),
tls = require('tls'),
fs = require('fs'),
dgram = require('dgram'),
EventParser = require('../entities/EventParser.js'),
Message = require('js-message'),
Events = require('event-pubsub');
import net from 'net';
import tls from 'tls';
import fs from 'fs';
import dgram from 'dgram';
import EventParser from '../entities/EventParser.js';
import Message from 'js-message';
import Events from 'event-pubsub';

@@ -16,18 +15,9 @@ let eventParser = new EventParser();

super();
Object.assign(
this,
{
config : config,
path : path,
port : port,
udp4 : false,
udp6 : false,
log : log,
server : false,
sockets : [],
emit : emit,
broadcast : broadcast
}
);
this.config = config;
this.path = path;
this.port = port;
this.log = log;
this.publish=super.emit;
eventParser=new EventParser(this.config);

@@ -41,4 +31,11 @@

udp4=false;
udp6=false;
server=false;
sockets=[];
emit=emit;
broadcast=broadcast;
onStart(socket){
this.trigger(
this.publish(
'start',

@@ -98,3 +95,3 @@ socket

}
socket.write(message);

@@ -316,4 +313,4 @@ }

path: this.path,
readableAll: true,
writableAll: true
readableAll: this.config.readableAll,
writableAll: this.config.writableAll
}, this.onStart.bind(this));

@@ -403,2 +400,5 @@

module.exports=Server;
export {
Server as default,
Server
};

@@ -1,66 +0,49 @@

'use strict';
import os from 'os';
/*eslint no-magic-numbers: ["error", { "ignore": [ 0] }]*/
class Defaults{
/**
* @module entities
*/
constructor(){
const os = require('os');
}
/**
* @class Defaults
* @description Defaults Entity
*/
class Defaults{
/**
* @constructor
* @method constructor
* @return {void}
*/
constructor(){
appspace='app.';
socketRoot='/tmp/';
id=os.hostname();
this.appspace='app.';
this.socketRoot='/tmp/';
this.id=os.hostname();
encoding='utf8';
rawBuffer=false;
sync=false;
unlink=true;
this.encoding='utf8';
this.rawBuffer=false;
this.sync=false;
this.unlink=true;
delimiter='\f';
this.delimiter='\f';
silent=false;
logDepth=5;
logInColor=true;
logger=console.log.bind(console);
this.silent=false;
this.logDepth=5;
this.logInColor=true;
this.logger=console.log.bind(console);
maxConnections=100;
retry=500;
maxRetries=Infinity;
stopRetrying=false;
this.maxConnections=100;
this.retry=500;
this.maxRetries=Infinity;
this.stopRetrying=false;
IPType=getIPType();
tls=false;
networkHost = (this.IPType == 'IPv6') ? '::1' : '127.0.0.1';
networkPort = 8000;
this.IPType=getIPType();
this.tls=false;
this.networkHost = (this.IPType == 'IPv6') ? '::1' : '127.0.0.1';
this.networkPort = 8000;
readableAll = false;
writableAll = false;
this.interface={
localAddress:false,
localPort:false,
family:false,
hints:false,
lookup:false
}
interface={
localAddress:false,
localPort:false,
family:false,
hints:false,
lookup:false
}
}
/**
* method to get ip type
*
* @method getIPType
* @return {string} ip type
*/
function getIPType() {

@@ -80,2 +63,5 @@ const networkInterfaces = os.networkInterfaces();

module.exports=Defaults;
export {
Defaults as default,
Defaults
}

@@ -1,4 +0,3 @@

'use strict';
const Defaults = require('./Defaults.js');
import Defaults from './Defaults.js';

@@ -32,2 +31,5 @@ class Parser{

module.exports=Parser;
export {
Parser as default,
Parser
};

@@ -1,21 +0,17 @@

'use strict';
import IPC from './services/IPC.js';
const IPC = require('./services/IPC.js');
class IPCModule extends IPC{
constructor(){
super();
//include IPC to make extensible
Object.defineProperty(
this,
'IPC',
{
enumerable:true,
writable:false,
value:IPC
}
)
}
IPC=IPC;
}
module.exports=new IPCModule;
const singleton=new IPCModule;
export {
singleton as default,
IPCModule
}
{
"name": "node-ipc",
"version": "9.1.5",
"version": "9.1.6",
"description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.",
"main": "node-ipc.js",
"type": "module",
"main": "node-ipc.cjs",
"module": "node-ipc.js",
"exports": {
"import": "./node-ipc.js",
"require": "./node-ipc.cjs"
},
"directories": {

@@ -10,24 +16,22 @@ "example": "example"

"engines": {
"node": ">=8.0.0"
"node": ">=14"
},
"dependencies": {
"event-pubsub": "4.3.0",
"event-pubsub": "5.0.3",
"js-message": "1.0.7",
"js-queue": "2.0.2"
"js-queue": "2.0.2",
"strong-type": "^1.0.1"
},
"devDependencies": {
"codacy-coverage": "2.0.0",
"jasmine": "2.4.1",
"istanbul": "0.4.1",
"node-cmd": "2.0.0"
"c8": "^7.7.3",
"esbuild": "^0.12.28",
"lcov2badge": "^0.1.2",
"node-cmd": "^4.0.0",
"node-http-server": "^8.1.4",
"vanilla-test": "^1.4.8"
},
"scripts": {
"test-windows": "istanbul cover -x **/spec/** -dir ./spec/coverage ./node_modules/jasmine/bin/jasmine.js",
"test": "istanbul cover -x **/spec/** -dir ./spec/coverage jasmine",
"cover": "istanbul cover -x **/spec/** -dir ./spec/coverage jasmine",
"coverup": "cat ./spec/coverage/lcov.info | codacy-coverage"
"test": "npm i && c8 -r lcov -r html node test/CI.js && c8 report && node ./lcov.js",
"coverage": "echo 'See your coverage report at http://localhost:8080' && node-http-server port=8080 root=./coverage/"
},
"pre-commit": [
"cover"
],
"keywords": [

@@ -34,0 +38,0 @@ "IPC",

+48
-20
node-ipc
================
[![Sponsor RIAEvangelist to help development of node-ipc](https://img.shields.io/static/v1?label=Sponsor%20Me%20On%20Github&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/RIAEvangelist)](https://github.com/sponsors/RIAEvangelist)
*a nodejs module for local and remote Inter Process Communication* with full support for Linux, Mac and Windows. It also supports all forms of socket communication from low level unix and windows sockets to UDP and secure TLS and TCP sockets.

@@ -7,4 +10,20 @@

**npm install node-ipc**
`npm install node-ipc`
#### for node <v14
`npm install node-ipc@^9.0.0`
#### including v10 or greater into your code
```js
//es6
import ipc from 'node-ipc'
//commonjs
const ipc = require('node-ipc').default;
```
#### NPM Stats

@@ -15,14 +34,13 @@

[![Package Quality](http://npm.packagequality.com/badge/node-ipc.png)](http://packagequality.com/#?package=node-ipc)
![node-ipc npm version](https://img.shields.io/npm/v/node-ipc.svg) ![supported node version for node-ipc](https://img.shields.io/node/v/node-ipc.svg) ![total npm downloads for node-ipc](https://img.shields.io/npm/dt/node-ipc.svg) ![monthly npm downloads for node-ipc](https://img.shields.io/npm/dm/node-ipc.svg) ![npm licence for node-ipc](https://img.shields.io/npm/l/node-ipc.svg)
![node-ipc npm version](https://img.shields.io/npm/v/node-ipc.svg) ![supported node version for node-ipc](https://img.shields.io/node/v/node-ipc.svg) ![total npm downloads for node-ipc](https://img.shields.io/npm/dt/node-ipc.svg) ![monthly npm downloads for node-ipc](https://img.shields.io/npm/dm/node-ipc.svg) ![npm licence for node-ipc](https://img.shields.io/npm/l/node-ipc.svg)
[![RIAEvangelist](https://avatars3.githubusercontent.com/u/369041?v=3&s=100)](https://github.com/RIAEvangelist)
GitHub info :
![node-ipc GitHub Release](https://img.shields.io/github/release/RIAEvangelist/node-ipc.svg) ![GitHub license node-ipc license](https://img.shields.io/github/license/RIAEvangelist/node-ipc.svg) ![open issues for node-ipc on GitHub](https://img.shields.io/github/issues/RIAEvangelist/node-ipc.svg)
Codacy info :
[![Codacy Badge](https://api.codacy.com/project/badge/grade/8e0294dff55f4ac1985c07b16f39d0a9)](https://www.codacy.com/app/RIAEvangelist/node-ipc) [![Codacy Badge](https://api.codacy.com/project/badge/coverage/8e0294dff55f4ac1985c07b16f39d0a9)](https://www.codacy.com/app/RIAEvangelist/node-ipc)
Code Coverage Info :
![lcov node-ipc](/coverage/lcov.svg)
Run `npm run coverage` to host a local version of the coverage report on [localhost:8080](http://localhost:8080) This is the same format as Istanbul and NYC. It should be very familiar.
Build Info :
Mac & Linux : [![Build Status](https://travis-ci.org/RIAEvangelist/node-ipc.svg?branch=master)](https://travis-ci.org/RIAEvangelist/node-ipc) Windows : [![node-ipc windows build status](https://ci.appveyor.com/api/projects/status/github/riaevangelist/node-ipc?branch=master&svg=true)](https://ci.appveyor.com/project/RIAEvangelist/node-ipc/history)
Testing done with [vanilla-test](https://github.com/RIAEvangelist/vanilla-test)
`vanilla-test` integrates with [c8](https://github.com/bcoe/c8) for native ESM coverage without the need to transpile your code. At the time of writing, this is the only way to natively test ESM, and it is amazing!

@@ -101,2 +119,4 @@ Package details websites :

networkPort : 8000,
readableAll : false,
writableAll : false,
encoding : 'utf8',

@@ -133,2 +153,4 @@ rawBuffer : false,

| networkPort| the default port on which TCP, TLS, or UDP sockets should connect |
| readableAll| makes the pipe readable for all users including windows services |
| writableAll| makes the pipe writable for all users including windows services |
| encoding | the default encoding for data sent on sockets. Mostly used if rawBuffer is set to true. Valid values are : ` ascii` ` utf8 ` ` utf16le` ` ucs2` ` base64` ` hex ` . |

@@ -494,3 +516,4 @@ | rawBuffer| if true, data will be sent and received as a raw node ` Buffer ` __NOT__ an ` Object ` as JSON. This is great for Binary or hex IPC, and communicating with other processes in languages like C and C++ |

const RawIPC=require('node-ipc').IPC;
import {IPCModule} from 'node-ipc';
const ipc=new RawIPC;

@@ -502,3 +525,3 @@ const someOtherExplicitIPC=new RawIPC;

const ipc=require('node-ipc');
const ipc=from 'node-ipc');
const someOtherExplicitIPC=new ipc.IPC;

@@ -531,3 +554,3 @@

var ipc=require('node-ipc');
import ipc from 'node-ipc';

@@ -569,3 +592,3 @@ ipc.config.id = 'world';

var ipc=require('node-ipc');
import ipc from 'node-ipc';

@@ -616,3 +639,3 @@ ipc.config.id = 'hello';

var ipc=require('../../../node-ipc');
import ipc from 'node-ipc';

@@ -812,8 +835,11 @@ ipc.config.id = 'world';

const fs = require('fs');
const ipc=require('../../../node-ipc');
const cpuCount = require('os').cpus().length;
const cluster = require('cluster');
const socketPath = '/tmp/ipc.sock';
import fs from 'fs';
import ipc from 'node-ipc';
import {cpus} from 'os';
import cluster from 'cluster';
const cpuCount=cpus().length;
const socketPath='/tmp/ipc.sock';
ipc.config.unlink = false;

@@ -852,4 +878,4 @@

const fs = require('fs');
const ipc = require('../../node-ipc');
import fs from 'fs';
import ipc from 'node-ipc';

@@ -889,1 +915,3 @@ const socketPath = '/tmp/ipc.sock';

See the [MIT license](https://github.com/RIAEvangelist/node-ipc/blob/master/license) file.
I'm sorry.

@@ -1,64 +0,59 @@

'use strict';
const Defaults = require('../entities/Defaults.js'),
Client = require('../dao/client.js'),
Server = require('../dao/socketServer.js'),
util = require('util');
import Defaults from '../entities/Defaults.js';
import Client from '../dao/client.js';
import Server from '../dao/socketServer.js';
import util from '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
}
}
);
}
//public members
config=new Defaults;
of={};
server=false;
//protected methods
get connectTo(){
return connect;
}
get connectToNet(){
return connectNet;
}
get disconnect(){
return disconnect
}
get serve(){
return serve;
}
get serveNet(){
return serveNet;
}
get log(){
return log;
}
set connectTo(value){
return connect;
}
set connectToNet(value){
return connectNet;
}
set disconnect(value){
return disconnect
}
set serve(value){
return serve;
}
set serveNet(value){
return serveNet;
}
set log(value){
return log;
}
}
function log(...args){

@@ -258,2 +253,3 @@ if(this.config.silent){

this.of[id].id = id;
(this.of[id].socket)? (this.of[id].socket.id=id):null;
this.of[id].path = path;

@@ -330,2 +326,3 @@

this.of[id].id = id;
(this.of[id].socket)? (this.of[id].socket.id=id):null;
this.of[id].path = host;

@@ -339,2 +336,5 @@ this.of[id].port = port;

module.exports=IPC;
export {
IPC as default,
IPC
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet