Connect with NodeJS ------------------- This example connects to RedisĀ®* service from NodeJS, making use of the ``ioredis`` library. Variables ''''''''' These are the placeholders you will need to replace in the code sample: ================== ============================================================= Variable Description ================== ============================================================= ``REDIS_URI`` URL for the Redis connection, from the service overview page ================== ============================================================= Pre-requisites '''''''''''''' Install the ``ioredis`` library: .. code:: npm install --save ioredis Code '''' Create a new file named ``index.js``, add the following content and replace the placeholder with the Redis URI: .. literalinclude:: /code/products/redis/connect.js :language: javascript This code creates a key named ``key`` with the value ``hello world`` and no expiration time. Then, it gets the key back from Redis and prints its value. Run the code: .. code:: node index.js If the script runs successfully, the outputs should be: .. code:: The value of key is: hello world