0.9.20 • Published 6 years ago

memshared v0.9.20

Weekly downloads
865
License
MIT
Repository
github
Last release
6 years ago

memshared

Build Status

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

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.

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

0.9.20

6 years ago

0.9.19

6 years ago

0.9.18

6 years ago

0.9.17

6 years ago

0.9.16

6 years ago

0.9.15

7 years ago

0.9.14

7 years ago

0.9.13

7 years ago

0.9.12

7 years ago

0.9.11

7 years ago

0.9.10

7 years ago

0.9.9

7 years ago

0.9.8

7 years ago

0.9.7

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.1.0

7 years ago