mbox-json
Parses MBOX file to JSON
Mail Labels (e.g. Time, From, Received, etc.) become attributes.
install
npm install mbox-json
example
var mboxJSON = require('mbox-json');
mboxJSON.parse(__dirname + '/Chat.mbox', function(data){
console.log(data);
console.log(data[0]);
console.log(data[0].Time);
console.log(data[0].From);
console.log(data[0]['Content-Type']);
console.log(data[0].Message);
});
api
parse(callback)
Type: function
Calls back with object containing array of messages.
data
Type: array
Message objects.
messageObject['Time']
Type: string
Time that message was sent.
messageObject['From']
Type: string
Sender of message.
messageObject['Content-Type']
Type: string
Content Type of message.
messageObject['Message']
Type: string
Content of message.
license
MIT © Rishi Masand