# share-memory-mac

> share-memory-mac

Latest version **1.1.3** (published 2021-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install share-memory-mac
pnpm add share-memory-mac
yarn add share-memory-mac
bun add share-memory-mac
```

## 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.1.3 |
| Published | 2021-04-29 |
| First published | 2021-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 15.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 0 |
| Author | gaobowen |
| Maintainers | gaobowen100 |
| Keywords | share-memory-mac |

## Links

- npm: https://www.npmjs.com/package/share-memory-mac
- Repository: https://github.com/gaobowen/share-memory-mac
- Homepage: https://github.com/gaobowen/share-memory-mac#readme
- Issues: https://github.com/gaobowen/share-memory-mac/issues
- npm.io page: https://npm.io/package/share-memory-mac

## Dependencies (3)

- [bindings](https://npm.io/package/bindings.md) ^1.5.0
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^3.1.0
- [node-gyp-build](https://npm.io/package/node-gyp-build.md) ^4.2.3

## Recent versions

- 1.1.3 (latest) — 2021-04-29
- 1.1.2 — 2021-04-29
- 1.1.1 — 2021-04-26
- 1.1.0 — 2021-04-26
- 1.0.8 — 2021-04-21
- 1.0.7 — 2021-04-20
- 1.0.6 — 2021-04-20
- 1.0.5 — 2021-04-20
- 1.0.4 — 2021-04-20
- 1.0.3 — 2021-04-20
- 1.0.2 — 2021-04-20
- 1.0.1 — 2021-04-19
- 1.0.0 — 2021-04-19

## README

# share-memory-mac
a share memory module between diffrent process on windows. runtime nodejs/electron.

## example
```js
const smemory = require('./index');
console.log('Init Share Memory=>', smemory);

const name = "share-memory-mac";

let ret = smemory.CreateShareMemory(name, 1280 * 720 * 4 * 3);
console.log('CreateShareMemory=>', ret);

let writebuff = Buffer.alloc(10);

writebuff[0] = 1;
writebuff[1] = 3;
writebuff[2] = 5;
writebuff[3] = 7;
writebuff[4] = 9;
ret = smemory.WriteShareMemoryFast(name, writebuff, 1);
console.log('WriteShareMemoryFast =>', ret);

readbuff = Buffer.alloc(10);
ret = smemory.ReadShareMemoryFast(name, readbuff);
console.log('ReadShareMemoryFast => ', ret, readbuff);

readbuff = Buffer.alloc(10);
ret = smemory.ReadShareMemoryFast(name, readbuff, 3);
console.log('ReadShareMemoryFast => ', ret, readbuff);


ret = smemory.DeleteShareMemory(name);
console.log('DeleteShareMemory => ', ret);

readbuff = Buffer.alloc(10);
ret = smemory.ReadShareMemoryFast(name, readbuff);
console.log('ReadShareMemoryFast => ', ret, readbuff);

smemory.DeleteShareMemory(name, 1280 * 720 * 4 * 3);

```

## install
### nodejs
```bash
npm i share-memory-mac
```
### electron
```
npm i share-memory-mac
npm i --save-dev electron-rebuild
npm i --save-dev electron-prebuilt
.\node_modules\.bin\electron-rebuild.cmd -v 10.1.5/your electron version -w share-memory-mac
```

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