Code from The Node Beginner Book.