New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nightmare-screenshoter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nightmare-screenshoter

Nightmare plugin for improved screenshot

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

nightmare-screenshoter

Extend Nightmare to improve screenshot with selector.

.screenshotSelector(path, selector)

Saves a screenshot of the element which matches the specified selector to the specified path.

Example

const Nightmare = require('nightmare');
const installPlugin = require('nightmare-screenshoter').installPlugin;

installPlugin(Nightmare);

const screenshotPath = path.join(process.cwd(), 'test.png');
new Nightmare()
  .goto('http://example.com')
  .screenshotSelector('test.png', 'h1')
  .then(() => {
    const stats = fs.statSync(screenshotPath);
    if (stats.isFile()) {
      console.log('DONE');
    }
  });

Keywords

nightmare

FAQs

Package last updated on 10 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts