Skip to content
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

HTML stream results in error #12

Closed
rbonomo opened this issue May 8, 2023 · 1 comment
Closed

HTML stream results in error #12

rbonomo opened this issue May 8, 2023 · 1 comment

Comments

@rbonomo
Copy link

rbonomo commented May 8, 2023

const EmlParser = require('eml-parser');
const fs = require('fs');

let emailFile = fs.createReadStream('./EMAIL.eml');

new EmlParser(emailFile).convertEmailToStream('html')
.then(stream => {
stream.pipe(fs.createWriteStream(emailFile.path + '.html'));
})
.catch(err => {
console.log(err);
})


OUTPUT

$ node ./index.js
node:events:491
throw er; // Unhandled 'error' event
^

Error: ENOENT: no such file or directory, open 'C:\tmp\html-pdf-19868.html'
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:2

  1. {
    errno: -4058,
    code: 'ENOENT',
    syscall: 'open',
    path: 'C:\tmp\html-pdf-19868.html'
    }

Node.js v18.16.0

@rbonomo
Copy link
Author

rbonomo commented May 8, 2023

Sorry, I just used your html example and that works.

@rbonomo rbonomo closed this as completed May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant