Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

headless-screenshot

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

headless-screenshot

headless chromium library for takaing website screenshots.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 13 Sep 2018

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc