Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2020 15:38
What would you like to do?
Using puppeteer@4.0.0 with typescript
import { Puppeteer } from 'puppeteer/lib/Puppeteer';
import findRoot from 'find-root';
import path from 'path';
import { initializePuppeteer } from 'puppeteer/lib/index';
const puppeteer = initializePuppeteer({
packageJson: require(path.join(findRoot(require.resolve('puppeteer')), 'package.json')),
rootDirectory: findRoot(require.resolve('puppeteer')),
export default puppeteer as Puppeteer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment