# memshared

> Redis-like in-memory database for NodeJS clustered applications

Latest version **0.9.20** (published 2018-05-13) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.20 |
| Published | 2018-05-13 |
| First published | 2017-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 139.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 29 |
| Author | Endel Dreyer |
| Maintainers | endel |

## Links

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

## Dependencies (1)

- [pm2](https://npm.io/package/pm2.md) ^2.10.1

## Recent versions

- 0.9.20 (latest) — 2018-05-13
- 0.9.19 — 2018-03-21
- 0.9.18 — 2018-03-21
- 0.9.17 — 2018-03-21
- 0.9.16 — 2018-03-21
- 0.9.15 — 2017-09-12
- 0.9.14 — 2017-06-14
- 0.9.13 — 2017-06-14
- 0.9.12 — 2017-05-30
- 0.9.11 — 2017-05-28
- 0.9.10 — 2017-05-27
- 0.9.9 — 2017-05-26
- 0.9.8 — 2017-05-26
- 0.9.7 — 2017-05-26
- 0.9.6 — 2017-05-16
- … 13 more at https://npm.io/package/memshared/versions

## README

# memshared

[![Build Status](https://secure.travis-ci.org/endel/memshared.png?branch=master)](http://travis-ci.org/endel/memshared)

Redis-like in-memory database for NodeJS clustered applications.

## Why?

Adding Redis as a dependency will inevitably increase the complexity to your
application and your environment. Use this library if you want to keep a simple
architecture while at the same time allow you to migrate to a real in-memory
database when you feel the need for it.

## Usage

```typescript
import * as cluster from "cluster";
import * as memshared from "memshared";

if (cluster.isMaster) {
  memshared.setup({
    // setup your initial data
  });

  cluster.fork();

} else {
  memshared.set('foo', 'bar');

  memshared.get('foo', function (err, result) {
    console.log(result);
  });

  memshared.del('key');

  memshared.sadd('set', 1);
}
```

## Usage with PM2

You'll need a script to start PM2. See [this example](pm2/pm2.js).

```
node pm2/pm2.js
```

## Missing commands

There are a lot of commands missing. Feel free to pick one of them and send a
pull-request: https://github.com/endel/memshared/issues/7

## License

MIT

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