Socket
Socket
Sign inDemoInstall

remote-screen-capture

Package Overview
Dependencies
116
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remote-screen-capture

Capture screenshots using selenium


Version published
Weekly downloads
10
increased by233.33%
Maintainers
1
Install size
36.1 MB
Created
Weekly downloads
 

Readme

Source

Remote Screen Capture

Capture screenshots from url.

Build Status npm version

It uses Selenium(Chrome) under the hood.

Install

Using npm:

npm install remote-screen-capture

Using yarn:

yarn add remote-screen-capture

Usage

NOTE: If you using ES6+ just import statements

Promise-based:

// Or 
const RemoteScreenCapture = require('remote-screen-capture').RemoteScreenCapture;

// If you want to encoded data
RemoteScreenCapture.take('https://www.google.com').toPromise().then(chunks => {
  console.log('Base64 Encoded Chunks', chunks);
});

// If you want to save image locally
RemoteScreenCapture.take('https://www.google.com', './images').toPromise().then(savePath => {
  console.log(`Saved to: ${savePath}`);
});

// Synchronous
const saveFilePath = await RemoteScreenCapture.take('https://www.google.com', './images').toPromise();

Observable-based:

const RemoteScreenCapture = require('remote-screen-capture').RemoteScreenCapture;

// If you want to encoded data
RemoteScreenCapture.take('https://www.google.com').subscribe(chunks => {
  console.log('Base64 Encoded Chunks', chunks);
});

// If you want to save image locally
RemoteScreenCapture.take('https://www.google.com', './images').subscribe(savePath => {
  console.log(`Saved to: ${savePath}`);
});

API

  • take(URI: string, options?: OptionsInterface)
    • options(width:number = 2880, height:number = 1800, savePath?: string)
  • takeByElementSelector(URI: string, selectorName: string, options?: OptionsInterface)
    • options(width:number = 2880, height:number = 1800, savePath?: string)

Where do I go for help?

If you need, open an issue.

Tests

npm test runs the jest tests.

npm run-script coverage runs the tests and reports code coverage.

#Contributing

If you want to contribute to the project (awesome!!), just pull request.

Keywords

FAQs

Last updated on 16 Jun 2019

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