Has anyone been using the mailparser npm package in Meteor?
I need to use it (or something just as simple) but, while it supports both callback and promise, the promise implementation in the simpleParser function is using a strange function parameter destructuring syntax (which I believe works in Node 6) that will not compile in Meteor 1.4+.
The offending js file is only 90 lines long at this location:
However, it is the last 10 lines (as follows) where the issue is:
function callbackPromise(resolve, reject) {
return function (...args) {
let err = args.shift();
if (err) {
reject(err);
} else {
resolve(...args);
}
};
}
The …args syntax causes an error. I am not using the promise mechanism and so I can edit this out in my local code but, of course, a CI build pulls down the module fresh.
Aside from forking the repo, making a very tiny change, and either issuing a pull request (or just using the modified repo directly), my questions are:
- is there an easier way to fix this (e.g. beta version of babel or such that might handle the syntax)?
- Is there any code similar to mailparser that others would recommend?
- does anyone know the timeline for Meteor to support Node 6?
[I’m looking for a quick solution as I have a looming deadline - the long solution would just be to fix it myself which is not possible at present due to time constraints]
Rgds