Install Client Library for Node
Install and Start Redis via brew
brew services start redis
Install and Start Redis on Windows
https://github.com/MicrosoftArchive/redis/releases
redis-server.exe
const redisUrl = 'redis//127.0.0.1:6379';
const client = redis.createClient(redisUrl);
Storing/Setting A Key-Value Pair
client.set('greeting', 'hello') // Returns true or false {'greeting': 'hello'}
// Returns true or false
client.get('greeting', (err,value) => {
console.log(value); // Will log 'hello'
}
client.get('greeting', console.log);