Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

find-chrome-bin

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-chrome-bin

Finds local Chromium binary to use it with puppeteer-core

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40K
decreased by-22.81%
Maintainers
1
Weekly downloads
 
Created
Source

Finds local Chromium to use it with puppeteer-core

  • Cross-platform. Works on win, mac and linux.

  • Small. Only 2.4 kB.

  • Zero-dependency.

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)
// { browser: "Google Chrome 96.0.4664.45", executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" }

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)
// { browser: "Google Chrome 96.0.4664.45", executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" }

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)
// { browser: "Chromium 94.0.4606.0", executablePath: "/Users/mbalabash/Projects/opensource/find-chrome-bin/example/chrome/mac-911515/chrome-mac/Chromium.app/Contents/MacOS/Chromium" }

Install

npm i find-chrome-bin

or

yarn add find-chrome-bin

License

MIT

Keywords

FAQs

Package last updated on 25 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc