Finds local Chromium to use it with puppeteer-core
Usage
By default, it tries to find Chromium v85+ binary with you can then use for launching puppeteer-core for your needs.
Respects CHROMIUM_EXECUTABLE_PATH
and PUPPETEER_EXECUTABLE_PATH
environment variables for CI purposes.
import { findChrome } from 'find-chrome-bin'
const chromeInfo = await findChrome()
console.log(chromeInfo)
Specifying min
and/or max
Chromium versions
You can configure a suitable version using min
and max
options.
import { findChrome } from 'find-chrome-bin'
const chromeInfo = await findChrome({ min: 95, max: 97 })
console.log(chromeInfo)
With fallback to download suitable Chromium revision
It can also download suitable Chromium revision as fallback (you have to provide puppeteer-core entity and Chromium revision to download
option).
import { join } from 'path'
import puppeteer from 'puppeteer-core'
import { PUPPETEER_REVISIONS } from 'puppeteer-core/lib/cjs/puppeteer/revisions.js'
import { findChrome } from 'find-chrome-bin'
let chromeInfo = await findChrome({
max: 95,
download: {
puppeteer,
path: join('.', 'chrome'),
revision: PUPPETEER_REVISIONS.chromium
}
})
console.log(chromeInfo)
Install
npm i find-chrome-bin
or
yarn add find-chrome-bin
License
MIT