@ev-fns/puppeteer
v0.1.4
Published
Async puppeteer handler, that manages creating and closing a browser
Downloads
13
Readme
@ev-fns/puppeteer
Async puppeteer handler, that manages creating and closing a browser
- withBrowser
(handler: (browser: puppeteer.Browser, page: puppeteer.Page) => Promise<void>) => Promise<void>
Install
yarn add @ev-fns/puppeteer
Usage
const { withBrowser } = require("@ev-fns/puppeteer");
withBrowser(async (browser, page) => {
await page.goto("https://www.npmjs.com/package/@ev-fns/puppeteer");
}).then(() => {
console.log("browser closed");
});