nanochrome

0.1.1 • Public • Published

nanochrome

Launch a Chrome Browser as a nanoprocess that leverages chrome-launcher.

Installation

$ npm install nanochrome

Status

Stable

Usage

const nanochrome = require('nanochrome')

const chrome = nanochrome('https://example.com')

chrome.open((err) => {
  // chrome browser window opened
})

API

const chrome = nanochrome(uri[, options])

Creates a new Chrome (nanoprocess) instance from uri with optional options that are passed directly to chrome.launch(). options can also be:

{
  app: false, // set to `true` to launch URI in application mode (--app=)
  headless: false, // set `true` to run headless (--headless)
}

See Chrome Flags for Tools for a complete list of useful flags that can be passed in the opts.chromeFlags array.

chrome.open([callback])

Opens the Google Chrome browser calling callback(err) upon success or error.

chrome.close([callback])

Closes the Google Chrome browser calling callback(err) upon success or error.

See Also

License

MIT

Dependents (0)

Package Sidebar

Install

npm i nanochrome

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

11 kB

Total Files

7

Last publish

Collaborators

  • werle