sider-mem
TypeScript icon, indicating that this package has built-in type declarations

1.3.1 • Public • Published

sider-mem

An in-memory datastore in node for Redis™1 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()

Option default Description
username "default" Enables authentication
password -
log debug-level Changes logger; e.g. to use console logging () => console
gracefulTimeout 100 (ms) Server timeout on shutdown
nextHouseKeepingSec 30 (s) Housekeeping interval for cleanup of expired keys
dbDir - Persistence: database directory for append only files
HashMap Map Use a different hash-map implementation than ES6 Map. See src/HampMap.js and src/MegaMap.js for possible implementations

server.listen()

Option default Description
port 6379 Listening Port
host 127.0.0.1 Set to 0.0.0.0 to accept incoming connections from any host

commands

Supported commands ⏬


license

MIT

  1. 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).

Package Sidebar

Install

npm i sider-mem

Weekly Downloads

1

Version

1.3.1

License

MIT

Unpacked Size

253 kB

Total Files

33

Last publish

Collaborators

  • commenthol