Nightmare is a node module which implements a high-level bridge between node.js and the headless PhantomJS browser. Nightmare v2 switches to electron (atom-shell) as the underlying browser. Please include the version that you use in your question.
Definition:
According to the Official Documentation:
Nightmare is a high-level browser automation library from Segment.
The goal is to expose a few simple methods that mimic user actions (like goto, type and click), with an API that feels synchronous for each block of scripting, rather than deeply nested callbacks. It was originally designed for automating tasks across sites that don't have APIs, but is most often used for UI testing and crawling.
Under the covers it uses Electron, which is similar to PhantomJS but roughly twice as fast and more modern.