client.quit() not waiting for commands to complete

Morning all, I'm looking into Redis at the moment and going through some tutorials. I'm running the latest redis container on windows and the basic code from the tutorial is

    var redis = require("redis"); // 1
    var client = redis.createClient(); // 2
    client.set("my_key", "Hello World using Node.js and Redis"); // 3
    client.get("my_key", redis.print); // 4

When I run this I get AbortError: Stream connection ended and command aborted. It might have been processed. So I thought maybe something messed up with my setup, however if I comment out the client.quit() command this completes successfully although it then keeps the connection open.

I'm sure this is down to my lack of knowledge of redis or containers or a combination of both but any assistance or pointers on how to make quit() wait for the process to complete would be appreciated. Cheers