In these exercises, we assume you will be running your Node.js programs on the same system as the Redis server. This is often a logical architecture, and you will need to adjust accordingly if the Redis server is running on a different system.
As a first step, create a directory for your Redis Node.js programs, and navigate to that directory from the terminal:
$ mkdir redis-node $ cd redis-node
Next, create a barebones
package.json file as follows:
$ npm init -y
For these exercises, we will be using an NPM package called ioredis for interacting with Redis. Install this package and save it as a dependency in your
$ npm install --save ioredis
We're ready to start writing some programs!