New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mailparser cannot be used with Deno #287
Comments
Maybe you could try this instead https://www.npmjs.com/package/postal-mime |
Now that Deno has better npm module support, this works for me: import { MailParser } from 'npm:mailparser';
const parser = new MailParser(); |
Is it just me or is MailParser unusably slow with Deno though? I can't quite figure out what's causing the slowdown... it seems to sit somewhere in |
I ran into that slowness also. I ended up using a Rust mail parsing library and calling it via WASM and it parses messages in the single digit milliseconds range. Here's my code, but it only extracts a few fields from the email. |
Thanks for that tip @canac . I ended up switching to https://github.com/emailjs/emailjs-mime-parser which seems to be much faster, but took a fair bit of work to get it to produce somethign similar to mailparser's output. I may yet go the same route as you with Rust, but I think this is good enough for now. I'm really curious if this is a Deno issue though, or if this happens under Node too. I don't have the time to try it out myself, but I couldn't find anyone else complaining about similar performance issues with mailparser under Node. I really want to ditch Node in favour of Deno, but I'm starting to worry about running into more and more issues like this the further I get. |
I don’t know much about Deno, but can you run my other email parsing library meant for browsers in Deno? https://github.com/postalsys/postal-mime |
Using the latest Deno (v1.6.2) throws this error when requiring mailparser. I think this is related to this issue
Run with:
deno run --unstable --allow-read --allow-env src/index.ts
Code used:
The text was updated successfully, but these errors were encountered: