From f35940636ee1e0cf91bd056ef92cc91c937dfcd6 Mon Sep 17 00:00:00 2001 From: Brandon Nozaki Miller Date: Wed, 7 Jul 2021 20:10:40 +0000 Subject: [PATCH] updated cluster docs --- README.md | 4 ++-- example/clusterUnixSocket/cluster-client.js | 4 ++-- example/clusterUnixSocket/cluster-server.js | 8 +++++--- node-ipc.js | 3 +++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 03f9f62..1c46ec5 100644 --- a/README.md +++ b/README.md @@ -808,10 +808,10 @@ Writing explicit buffers, int types, doubles, floats etc. as well as big endian ```javascript - import fs from 'fs' + import fs from 'fs'; import ipc from 'node-ipc'; import {cpus} from 'os'; - import cluster from 'cluster' + import cluster from 'cluster'; const cpuCount=cpus().length; diff --git a/example/clusterUnixSocket/cluster-client.js b/example/clusterUnixSocket/cluster-client.js index e1eb20b..75ece82 100644 --- a/example/clusterUnixSocket/cluster-client.js +++ b/example/clusterUnixSocket/cluster-client.js @@ -1,5 +1,5 @@ -const fs = from 'fs'); -const ipc = from '../../node-ipc'); +import fs from 'fs'; +import ipc from '../../node-ipc'; const socketPath = '/tmp/ipc.sock'; diff --git a/example/clusterUnixSocket/cluster-server.js b/example/clusterUnixSocket/cluster-server.js index c1cdf31..624ac02 100644 --- a/example/clusterUnixSocket/cluster-server.js +++ b/example/clusterUnixSocket/cluster-server.js @@ -1,7 +1,9 @@ -const fs = from 'fs'); import ipc from '../../../node-ipc.js'; -const cpuCount = from 'os').cpus().length; -const cluster = from 'cluster'); +import fs from 'fs'; +import {cpus} from 'os'; +import cluster from 'cluster'; + +const cpuCount=cpus().length; const socketPath = '/tmp/ipc.sock'; ipc.config.unlink = false; diff --git a/node-ipc.js b/node-ipc.js index 1587546..2a949d0 100644 --- a/node-ipc.js +++ b/node-ipc.js @@ -3,7 +3,10 @@ import IPC from './services/IPC.js'; class IPCModule extends IPC{ constructor(){ super(); + } + + IPC=IPC; } const singleton=new IPCModule;