# capture-chrome

> Capture screenshots using Chrome

Latest version **3.0.1** (published 2019-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install capture-chrome
pnpm add capture-chrome
yarn add capture-chrome
bun add capture-chrome
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2019-06-05 |
| First published | 2017-09-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 56 |
| Author | Julian Gruber |
| Maintainers | juliangruber |
| Keywords | chrome, chromium, screenshot, headless |

## Links

- npm: https://www.npmjs.com/package/capture-chrome
- Repository: https://github.com/juliangruber/capture-chrome
- Issues: https://github.com/juliangruber/capture-chrome/issues
- npm.io page: https://npm.io/package/capture-chrome

## Dependencies (3)

- [temp-dir](https://npm.io/package/temp-dir.md) ^1.0.0
- [puppeteer](https://npm.io/package/puppeteer.md) ^1.7.0
- [yoctodelay](https://npm.io/package/yoctodelay.md) ^1.1.0

## Recent versions

- 3.0.1 (latest) — 2019-06-05
- 3.0.0 — 2018-08-16
- 2.0.0 — 2017-10-16
- 1.0.6 — 2017-10-15
- 1.0.5 — 2017-09-23
- 1.0.4 — 2017-09-16
- 1.0.3 — 2017-09-16
- 1.0.2 — 2017-09-16
- 1.0.1 — 2017-09-16
- 1.0.0 — 2017-09-16

## README

# capture-chrome

Capture screenshots using Chrome's new headless mode. This means it does _not_
require a graphical environment / X server to run!

Also you don't even need to have Chromium or Chrome installed, this will fetch an up
to date binary for you.

[![build status](https://secure.travis-ci.org/juliangruber/capture-chrome.svg)](https://travis-ci.org/juliangruber/capture-chrome) [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/capture-chrome.svg)](https://greenkeeper.io/)

## Example

Capture a `1024x768` screenshot of [github.com](http://github.com):

```js
const capture = require('capture-chrome')
const fs = require('fs')

capture({
  url: 'https://github.com/'
}).then(screenshot => {
  fs.writeFileSync(`${__dirname}/example.png`, screenshot)
  console.log('open example.png')
})
```

![github.com](https://raw.github.com/juliangruber/capture-chrome/master/example.png)

## API

### screenshot({ url, width = 1024, height = 768, wait = 0 })

Capture a screenshot of `url`, returns a `Promise` which resolves with a buffer.

Options:

- `url` Page url
- `width` Viewport width
- `height` Viewport height
- `wait` Time in `ms` to wait after the page finished loading all resources

## Installation

With [npm](https://npmjs.org) do:

```bash
npm install capture-chrome
```

## CI

This project will work in CI environments like Travis and AppVeyor without any additional configuration. It fetches Chromium itself and doesn't need a X server to run.

## Related projects

- __[capture-screenshot](https://github.com/juliangruber/capture-screenshot)__ &mdash; Capture screenshots in multiple browsers
- __[capture-electron](https://github.com/juliangruber/capture-electron)__ &mdash; Capture screenshots using Electron
- __[capture-phantomjs](https://github.com/juliangruber/capture-phantomjs)__ &mdash; Capture screenshots using PhantomJS

## License

(MIT)

Copyright (c) 2017 Julian Gruber &lt;julian@juliangruber.com&gt;

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

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