# ukogi

> A wrapper for Electron IPC for both main and renderer processes

Latest version **0.0.2** (published 2020-01-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install ukogi
pnpm add ukogi
yarn add ukogi
bun add ukogi
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-01-19 |
| First published | 2019-10-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 39.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Zack Guard |
| Maintainers | z------------- |

## Links

- npm: https://www.npmjs.com/package/ukogi
- Repository: https://github.com/z-------------/ukogi
- Homepage: https://github.com/z-------------/ukogi#readme
- Issues: https://github.com/z-------------/ukogi/issues
- npm.io page: https://npm.io/package/ukogi

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^3.3.3
- [is-electron-renderer](https://npm.io/package/is-electron-renderer.md) ^2.0.1

## Recent versions

- 0.0.2 (latest) — 2020-01-19
- 0.0.0 — 2019-10-11

## README

# ukogi

A wrapper for Electron IPC for both main and renderer processes.

## Functions

<dl>
<dt><a href="#on">on(channel, callback)</a></dt>
<dd><p>Register a handler for an IPC channel</p>
</dd>
<dt><a href="#send">send(channel, arg, callback)</a></dt>
<dd><p>Send a message through an IPC channel and receive the response</p>
</dd>
</dl>

<a name="on"></a>

## on(channel, callback)
Register a handler for an IPC channel

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| channel | <code>string</code> | Name of the channel |
| callback | <code>function</code> | Callback to run when a message is received on this channel, called with arguments (event, arg, reply). Arguments passed to reply(arg) will be received by the callback in the corresponding `ukogi.send` call. |

**Example**  
```js
ukogi.on("my-channel", (event, arg, reply) => {
  if (arg.flag) reply(42);
});
```
<a name="send"></a>

## send(channel, arg, callback)
Send a message through an IPC channel and receive the response

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| channel | <code>string</code> | Name of the channel |
| arg | <code>\*</code> | Argument to pass |
| callback | <code>function</code> | Callback to run when a reply is received on this channel, called with arguments (event, arg). Arguments passed to the corresponding `ukogi.on` call's reply(arg) will be received here. |

**Example**  
```js
ukogi.send("my-channel", { flag: true }, (event, arg) => console.log(arg)); // -> 42
```

## License

MIT License

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