How to save a web page as PNG or PDF with Nightmare?

Introduction

In this example we’ll see how to utilize Nightmare, Xvfb and how to properly bootstrap the main application code in order to make a cross-platform HTML → PDF script.