Example code found in the book Node The Right Way