🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

webpack-electroshot-plugin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-electroshot-plugin

Webpack plugin for electroshot.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

webpack-electroshot-plugin

Webpack plugin for electroshot.

Capture website screenshots with optional device and network emulation as jpg, png or pdf (with web fonts!) using Electron / Chrome.

npm node npmd deps ddeps standard

Install

npm

npm install -D webpack-electroshot-plugin

yarn

yarn add -D webpack-electroshot-plugin

electroshot

npm install -D electroshot
// or global
npm install -g electroshot

Usage

const WebpackElectroshotPlugin = require('webpack-electroshot-plugin')
// or
import WebpackElectroshotPlugin from 'webpack-electroshot-plugin'
{
  output: {
    path: "/output/path"
  },
  plugins: [
    new WebpackElectroshotPlugin({
      // options
    })
  ]
}

API

class WebpackElectroshotPlugin([options])

options

All options of electroshot are available in camelCase.

See electroshot docs.

Required
  • filename
Optional
  • delay: default: 1000
  • format: default: jpg
  • out: default: .
  • resolution: default: 1280
  • url: default: index.html
  • cookie
  • css
  • device
  • download
  • emulateNetwork
  • forceDeviceScaleFactor
  • ignoreCertificateErrors
  • js
  • latency
  • pdfBackground
  • pdfMargin
  • pdfOrientation
  • pdfPageSize
  • proxyServer
  • quality
  • selector
  • upload
  • userAgent
  • zoomFactor

Examples

JPG

Will create BUILD_PATH/screenshot.jpg:

new WebpackElectroshotPlugin({
  filename: `screenshot.jpg`
})

PNG

Will create BUILD_PATH/screenshot.png:

new WebpackElectroshotPlugin({
  filename: `screenshot.png`,
  format: 'png'
})

PDF

Will create BUILD_PATH/screenshots/screenshot.pdf:

new WebpackElectroshotPlugin({
  filename: `screenshot.pdf`,
  format: 'pdf',
  out: 'screenshots',
  pdfBackground: true,
  pdfMargin: 'none',
  pdfPageSize: 'A4'
})

Resources

  • electroshot - Capture website screenshots with optional device and network emulation as jpg, png or pdf (with web fonts!) using Electron / Chrome.

Authors

License

MIT

Keywords

webpack

FAQs

Package last updated on 15 Sep 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