Scrape content from websites that don't have a public API by navigating pages and extracting text or links.
Automate form submissions and data entry tasks on websites by typing into fields and clicking buttons.
Test web application UI by simulating user interactions and verifying that pages behave correctly.
Library is unmaintained; may have compatibility issues with modern Node.js versions.
Nightmare is a JavaScript browser automation library built on top of Electron (the same technology used by the VS Code desktop app). It lets you write scripts that control a real browser, navigating to pages, typing into fields, clicking buttons, waiting for elements to appear, and reading content back out, all from Node.js code. It is no longer maintained, but is documented here for reference. The key design goal was to make browser automation feel like a simple, readable sequence of steps rather than deeply nested callback code. You chain actions together, and each action in the chain waits for the previous one to complete before running. For example, a script to search DuckDuckGo would navigate to the page, type a query into the search box, click the search button, wait for results to appear, and then extract a link, all as a linear chain of method calls. Results are returned as JavaScript Promises. It was designed for two main use cases: automating tasks on websites that have no public API (scraping or form submission), and UI testing where you want to verify that a web page behaves correctly when a user interacts with it. Electron, the underlying runtime, is essentially a full Chromium browser, so Nightmare executes in a real browser context rather than a simulated one. The companion tool Daydream is a Chrome extension that watches your own browsing and generates Nightmare scripts automatically. Niffy is a visual testing tool that uses Nightmare to take screenshots and compare them across releases to catch unintended UI changes. The library is written in JavaScript and runs on Node.js.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.