0.2.7 • Published 4 years ago

monochrome-js v0.2.7

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Mono Chrome

Library to manage Chrome instance spawned by Puppeteer

Background

Puppeteer offers two kinds of Chrome initiation method, by launching a new instance or connecting to an already running process using web socket.

When utilizing Puppeteer, it's not advisable to keep launching and closing Chrome instance over and over again since it will consume a lot of resources. So Monochrome helps managing the spawned instances and allow user to connect to an existing one if possible and only launches a new one if no Chrome instance is available.

Installation

$ npm install monochrome-js

Usage

const Monochrome = require("monochrome-js");
const monochrome = new Monochrome();

// get a browser instance
const browser = await monochrome.getBrowser();

// call Puppeteer functions
await browser.newPage();

// close instance
await browser.disconnect();

NOTE: ALWAYS use disconnect() instead of close() to make the browser instance reusable

0.2.7

4 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago