Skip to content

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Launch a Chrome Browser as a nanoprocess (nanoresource).

Topics

Resources

Stars

6 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages