1.0.0 • Published 9 years ago

mbox-json v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

mbox-json

Parses MBOX file to JSON

Mail Labels (e.g. Time, From, Received, etc.) become attributes.

https://nodei.co/npm/mbox-json.png?downloads=true&downloadRank=true&stars=true

Build Status contributions welcome

install

npm install mbox-json

example

var mboxJSON = require('mbox-json');

mboxJSON.parse(__dirname + '/Chat.mbox', function(data){
	console.log(data); // prints array of messages
	console.log(data[0]); // prints first message
	console.log(data[0].Time); // prints timestamp of when first message was sent
	console.log(data[0].From); // prints sender of first message
	console.log(data[0]['Content-Type']); // prints content type of first message
	console.log(data[0].Message); // prints message content of first 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