Skip to content

Commit

Permalink
fix: shut down puppeteer on process.exit
Browse files Browse the repository at this point in the history
Shutdown down the puppeteer renderer on process.exit.
  • Loading branch information
jniles committed May 27, 2020
1 parent 3631ec1 commit 121e010
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,9 @@ async function render(html, options = {}) {
}
}

process.on('exit', async () => {
browser.removeAllListeners();
await browser.close();
});

module.exports = render;

0 comments on commit 121e010

Please sign in to comment.