# xrom

> Run [dockerized Chromium or Firefox in headless remote debugging mode](https://github.com/nextools/images) and return `browserWSEndpoint` needed for `puppeteer.connect()`.

Latest version **3.0.2** (published 2020-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install xrom
pnpm add xrom
yarn add xrom
bun add xrom
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2020-09-28 |
| First published | 2020-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.13.0 |
| Dependencies | 5 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 81 |
| Maintainers | fosimus, psxcode, deepsweet |

## Links

- npm: https://www.npmjs.com/package/xrom
- Repository: https://github.com/nextools/metarepo
- Homepage: https://github.com/nextools/metarepo#readme
- Issues: https://github.com/nextools/metarepo/issues
- npm.io page: https://npm.io/package/xrom

## Dependencies (5)

- [tsfn](https://npm.io/package/tsfn.md) ^2.1.0
- [sleap](https://npm.io/package/sleap.md) ^0.1.0
- [spown](https://npm.io/package/spown.md) ^0.1.1
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.8.0

## Recent versions

- 3.0.2 (latest) — 2020-09-28
- 3.0.1 — 2020-09-25
- 3.0.0 — 2020-08-14
- 2.0.1 — 2020-08-06
- 2.0.0 — 2020-06-17
- 1.0.4 — 2020-03-12
- 1.0.3 — 2020-02-17
- 1.0.2 — 2020-01-31
- 1.0.1 — 2020-01-29
- 1.0.0 — 2020-01-23
- 0.0.0 — 2020-01-22

## README

# xrom ![npm](https://flat.badgen.net/npm/v/xrom)

Run [dockerized Chromium or Firefox in headless remote debugging mode](https://github.com/nextools/images) and return `browserWSEndpoint` needed for `puppeteer.connect()`.

## Install

```sh
$ yarn add xrom
```

## Usage

```ts
type TRunBrowserOptions = {
  browser: 'chromium' | 'firefox',
  version: string,
  port?: number,
  fontsDir?: string,
  mountVolumes?: {
    from: string,
    to: string,
  }[],
  cpus?: number,
  cpusetCpus?: number[]
}

type TRunBrowserResult = {
  browserWSEndpoint: string,
  closeBrowser: () => Promise<void>,
}

runBrowser(options: TRunBrowserOptions) => Promise<TRunBrowserResult>
```

```js
import { runBrowser } from 'xrom'
import puppeteer from 'puppeteer-core'

const { browserWSEndpoint } = await runBrowser({ browser: 'chromium' })
const browser = await puppeteer.connect({ browserWSEndpoint })
```

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