railsware / mailtrap-nodejs

Official mailtrap.io Node.js client
https://mailtrap.io
MIT License
58 stars 6 forks source link

Issue with fs Module Compatibility #20

Closed mrtozner closed 1 year ago

mrtozner commented 1 year ago

After the recent update to mailtrap-nodejs, it seems that the library now relies on the fs module, which might not be compatible with all Node.js versions. This can potentially cause issues for projects, especially those running in Docker containers like myself, where lower Node.js versions are often preferred for compatibility reasons. Ideally, the library should maintain compatibility with a broader range of Node.js versions to avoid such issues for users who need to use older Node.js versions for their projects.

My suggestions:

Revert the Update: Consider reverting the recent update that introduced the dependency on the fs module. This would ensure that the library remains compatible with older Node.js versions.

Add Compatibility Warning: If the dependency on fs is required for specific functionality, consider adding a warning or documentation update to inform users about the Node.js version compatibility requirements. This way, users can make informed decisions and take appropriate actions.

Thank you for your attention to this matter

VladimirTaytor commented 1 year ago

Hello, thanks for reaching out to us!

You have valid point regarding backward compatibility and previously we were not stating any info about supported version of Node.js Starting from the latest release we have explicitly stated, that we require node >= 16.20.1, as there is optional chaining in our codebase and some other features we use: package.json

  "engines": {
    "node": ">=16.20.1",
    "yarn": ">=1.22.17"
  },

Also, we strongly recommend to use LTS versions of Node.js due to security reasons. But if there will be a lot of requests, we can consider adding the support for older versions 👍

What version of Node.js you were using?

mrtozner commented 1 year ago

Thank you for your clarification. I use Node.js version 15.5.1. To solve the compatibility issue, I use mailtrap version 3.1.1. I thought it would be helpful to share this with you so that you are aware of the specific versions that some of your users might be on.

Thank you for your support and for considering the needs of your user community. 👍