3.0.2 • Published 4 years ago

xrom v3.0.2

Weekly downloads
131
License
MIT
Repository
github
Last release
4 years ago

xrom npm

Run dockerized Chromium or Firefox in headless remote debugging mode and return browserWSEndpoint needed for puppeteer.connect().

Install

$ yarn add xrom

Usage

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>
import { runBrowser } from 'xrom'
import puppeteer from 'puppeteer-core'

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

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.0

4 years ago