forwardemail / email-templates

Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for @forwardemail, @ladjs, @cabinjs, @spamscanner, and @breejs.
https://forwardemail.net/docs/send-emails-with-node-js-javascript
MIT License
3.67k stars 337 forks source link

requiring library causes memory leak due to indirect dependency on node-graceful-fs #318

Closed shusson closed 6 years ago

shusson commented 6 years ago

Requiring this library multiple times causes a memory leak. It is caused by a dependency on fs-extra which has a dependency on graceful-fs. See https://github.com/isaacs/node-graceful-fs/issues/102.

niftylettuce commented 6 years ago

thanks, will patch right now, I patched this in another one of my projects and will do here as well

niftylettuce commented 6 years ago

see https://github.com/niftylettuce/email-templates/commit/d187d532b1e6e7912bc7e49efef091b1410c8207 - I removed it from the project but did not realize get-paths has it as well, fixing

niftylettuce commented 6 years ago

@shusson please try v4.0.4, and let me know! I just published the fix

ref: https://github.com/niftylettuce/get-paths/commit/34c11b3627cff517f8ed5cf28db65817fe7622c4 https://github.com/niftylettuce/preview-email/commit/c8945b4e3807699b6d020b2dd3cb6781044c22c2 https://github.com/niftylettuce/preview-email/commit/3bd9121782c0d56cba422330343825e90b891143

shusson commented 6 years ago

Thanks @niftylettuce, fix confirmed 👍