# @clusic/ipc

> An ipc-message classic model of node application framework for clusic

Latest version **1.0.2** (published 2018-10-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @clusic/ipc
pnpm add @clusic/ipc
yarn add @clusic/ipc
bun add @clusic/ipc
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-10-16 |
| First published | 2018-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | cevio |
| Maintainers | evio |

## Links

- npm: https://www.npmjs.com/package/@clusic/ipc
- Repository: https://github.com/clusic/ipc
- Homepage: https://github.com/clusic/ipc#readme
- Issues: https://github.com/clusic/ipc/issues
- npm.io page: https://npm.io/package/@clusic/ipc

## Recent versions

- 1.0.2 (latest) — 2018-10-16
- 1.0.1 — 2018-10-15
- 1.0.0 — 2018-10-15

## README

# IPC channel process controller

IPC 信息通道管理模型。

## Install

```shell
npm i @clusic/ipc
```

## Usage

```javascript
const IPC = require('@clusic/ipc');
module.exports = class Master extends IPC {
  constructor() {
    super();
    this.on('message', (msg, socket) => {
      // ...
    })
  }
}
```

## API

### ipc.register(name, agent)

```javascript
const agent = ChildProcess.fork('./agent.js');
const IPC = require('@clusic/ipc');
const ipc = new IPC();
ipc.register('agent', agent);
```

### ipc.send(to, action, body, socket)

```javascript
const agent = ChildProcess.fork('./agent.js');
const IPC = require('@clusic/ipc');
const ipc = new IPC();
ipc.register('agent', agent);
ipc.send('master', 'test:action', { a: 1, b: 2 });
```

---
_Source: https://npm.io/package/@clusic/ipc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
