1.0.16 • Published 5 years ago

remote-screen-capture v1.0.16

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

Remote Screen Capture

Capture screenshots from url.

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.

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago