Creating new phantom instances with
puppeteer.launch() can be slow. If
you are frequently creating new instances and destroying them, as a
result of HTTP requests for example, this module can help by keeping a
pool of puppeteer instances alive and making it easy to re-use them across
npm install --save puppeteer-pool
Requires Node v6+
const createPuppeteerPool =// Returns a generic-pool instanceconst pool =// Automatically acquires a puppeteer instance and releases it back to the// pool when the function resolves or throwspool// Destroying the pool:pool// For more API doc, see
When using puppeteer-pool, you should be aware that the puppeteer instance you are getting might not be in a completely clean state. It could have browser history, cookies or other persistent data from a previous use.
If that is an issue for you, make sure you clean up any sensitive data on the puppeteer instance before returning it to the pool.
This module is forked from phantom-pool and all phantom related code has been sustituted with puppeteer.