Skip to content

Instantly share code, notes, and snippets.

@jsoverson
Created June 17, 2020 15:38
Show Gist options
  • Save jsoverson/43b4176a3ed47baea2653eb4450e5e0b to your computer and use it in GitHub Desktop.
Save jsoverson/43b4176a3ed47baea2653eb4450e5e0b to your computer and use it in GitHub Desktop.
Using [email protected] 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