1.3.1 • Published 8 months ago

sider-mem v1.3.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

sider-mem

An in-memory datastore in node for Redis™^redis compatible clients

Supports:

Does not (yet) support:

  • transactions (rollback on error)
  • sets
  • streams
  • partitioning
  • replication

installation

npm i sider-mem

start the server

npx sider-mem --port 6379 --user alice --password somepassword

usage

const { Server } = require('sider-mem')

// start the server
const server = new Server({username: 'alice', password: 'somepassword'})
await server.listen({ port: 6379 })

// ...

// disconnect
await server.close()

connect with client

const redis = require('redis')

const client = redis.createClient({user: 'alice', password: 'somepassword'})

client.ping((err, data) => console.log(data)) // PONG

See example for use with a clustered app. Start with npm run example and browse to http://localhost:3000

API

new Server()

OptiondefaultDescription
username"default"Enables authentication
password-
logdebug-levelChanges logger; e.g. to use console logging () => console
gracefulTimeout100(ms) Server timeout on shutdown
nextHouseKeepingSec30(s) Housekeeping interval for cleanup of expired keys
dbDir-Persistence: database directory for append only files
HashMapMapUse a different hash-map implementation than ES6 Map. See src/HampMap.js and src/MegaMap.js for possible implementations

server.listen()

OptiondefaultDescription
port6379Listening Port
host127.0.0.1Set to 0.0.0.0 to accept incoming connections from any host

commands

license

MIT

^redis: Redis is a trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by this documentation is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and the author(s).

1.3.1

8 months ago

1.3.0

2 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago