My name is
Jurgens du Toit.
Systems Developer.
Problem Solver.
Technology and Solving Problems are my passion. I'm a South African that loves my wife, life, and coding.
I need to parse Emails in node.js and after looking around on the web, I didn’t find much. Oh, no, I’ll have to write it myself… :)
The source is hosted on GitHub .
Here’s an example:
var fs = require('fs')
, sys = require('sys')
, em_parse = require('./parser_email')
stream = fs.ReadStream(file);
stream.setEncoding('ascii');
stream.on('data', function(data) {
mail += data;
});
stream.on('close', function () {
parser = em_parse.parser_email();
parser.setContent(mail);
parser.parseMail();
});