Socket
Socket
Sign inDemoInstall

headless-screenshot

Package Overview
Dependencies
2
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    headless-screenshot

headless chromium library for takaing website screenshots.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.96 MB
Created
Weekly downloads
 

Readme

Source

headless-screenshot

npm package

Build Status Coverage Status Greenkeeper badge

headless-screenshot is a high-level on top of headless embedded chromium browser (puppeteer). It provides safe & easy to use interface for taking screenshot of websites.

Built with :heart:

Install

headless-screenshot depends on puppeteer, ensure its installed globally or locally before using this library.

npm i puppeteer headless-screenshot

Usage:

const HeadShot = require('headless-screenshot');
const Promise = require('bluebird');
const writeFile = Promise.promisify(require('fs').writeFile);

let hc = new HeadShot() // browser instance
hc.setup() // launches embedded chromium instance
  .then(() =>
    hc.getScreenshot('https://example.com')
    .then( res => {
      console.log(`resolvedUrl: ${res.resolvedUrl}, originalUrl: ${res.url}, isReachable: ${res.isReachable}`);
        writeFile('./example.png',res.data).then(() => console.log('file is written'));
    }).finally(() => hc.destroy())

For reference look at test cases.

Keywords

FAQs

Last updated on 13 Sep 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc