diff --git a/index.js b/index.js index ef12f80..3d8a831 100644 --- a/index.js +++ b/index.js @@ -110,4 +110,9 @@ async function render(html, options = {}) { } } +process.on('exit', async () => { + browser.removeAllListeners(); + await browser.close(); +}); + module.exports = render;