Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/little-core-labs/nanochrome
Launch a Chrome Browser as a nanoprocess (nanoresource).
https://github.com/little-core-labs/nanochrome
chrome launch nanoprocess nanoresource
Last synced: 3 months ago
JSON representation
Launch a Chrome Browser as a nanoprocess (nanoresource).
- Host: GitHub
- URL: https://github.com/little-core-labs/nanochrome
- Owner: little-core-labs
- License: mit
- Created: 2019-10-28T00:33:33.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-08T00:10:49.000Z (about 5 years ago)
- Last Synced: 2024-07-19T16:37:14.900Z (4 months ago)
- Topics: chrome, launch, nanoprocess, nanoresource
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nanochrome
==========> Launch a Chrome Browser as a [nanoprocess][nanoprocess] that leverages
> [chrome-launcher][chrome-launcher].## Installation
```sh
$ npm install nanochrome
```## Status
> **Stable**
## Usage
```js
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][nanoprocess]) instance from `uri`
with optional `options` that are passed directly to
[`chrome.launch()`](
https://github.com/GoogleChrome/chrome-launcher#launchopts). `options` can also be:```js
{
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](https://github.com/GoogleChrome/chrome-launcher/blob/HEAD/docs/chrome-flags-for-tools.md) 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
- [nanoprocess][nanoprocess]
- [nanoresource][nanoresource]
- [chrome-launcher][chrome-launcher]## License
MIT
[nanoprocess]: https://github.com/little-core-labs/nanoprocess
[nanoresource]: https://github.com/mafintosh/nanoresource
[chrome-launcher]: https://github.com/GoogleChrome/chrome-launcher