# remote-screen-capture

> Capture screenshots using selenium

Latest version **1.0.16** (published 2019-06-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install remote-screen-capture
pnpm add remote-screen-capture
yarn add remote-screen-capture
bun add remote-screen-capture
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.16 |
| Published | 2019-06-16 |
| First published | 2019-06-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 5.5 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Hax0r |
| Maintainers | hax0r |
| Keywords | capture, remote, screen-capture, capture-from-url, screenshot, node |

## Links

- npm: https://www.npmjs.com/package/remote-screen-capture
- Repository: https://github.com/webhacking/remote-screen-capture
- Homepage: https:/github.com/webhacking/remote-screen-capture
- Issues: https:/github.com/webhacking/remote-screen-capture/issues
- npm.io page: https://npm.io/package/remote-screen-capture

## Dependencies (4)

- [rxjs](https://npm.io/package/rxjs.md) ^6.5.1
- [ts-node](https://npm.io/package/ts-node.md) ^8.1.0
- [chromedriver](https://npm.io/package/chromedriver.md) 74.0.0
- [selenium-webdriver](https://npm.io/package/selenium-webdriver.md) 4.0.0-alpha.1

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.16 (latest) — 2019-06-16
- 1.0.15 — 2019-06-13
- 1.0.14 — 2019-06-13
- 1.0.13 — 2019-06-07
- 1.0.12 — 2019-06-07
- 1.0.11 — 2019-06-04
- 1.0.10 — 2019-06-04
- 1.0.9 — 2019-06-04
- 1.0.8 — 2019-06-04
- 1.0.7 — 2019-06-04
- 1.0.6 — 2019-06-04
- 1.0.5 — 2019-06-04
- 1.0.4 — 2019-06-04
- 1.0.3 — 2019-06-04
- 1.0.2 — 2019-06-04
- … 2 more at https://npm.io/package/remote-screen-capture/versions

## README

## Remote Screen Capture
> Capture screenshots from url.
<p align="left">
<a href="https://travis-ci.org/webhacking/remote-screen-capture"><img src="https://travis-ci.org/webhacking/remote-screen-capture.svg?branch=master" alt="Build Status"></a>
<a href="https://codecov.io/gh/webhacking/remote-screen-capture"><img src="https://codecov.io/gh/webhacking/remote-screen-capture/branch/master/graph/badge.svg" /></a>
<a href="https://badge.fury.io/js/remote-screen-capture"><img src="https://badge.fury.io/js/remote-screen-capture.svg" alt="npm version" height="18"></a>
</p>


It uses [Selenium](https://www.seleniumhq.org/)(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:
```javascript
// 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:
```javascript
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.

---
_Source: https://npm.io/package/remote-screen-capture · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
