Email Parser for node.js


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();
});
Filed Under

blog comments powered by Disqus
My name is
Jurgens du Toit.
I love web development and anything internet related. This is my home site and playground.

Follow me on Twitter. Now.   Find me on Linked In.
Find me on Facebook. Read my Blog.