Giter Club home page Giter Club logo

sider-mem's Introduction

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

Footnotes

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

sider-mem's People

Contributors

commenthol avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lmangani

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.