1.0.1 • Published 2 years ago

@d4data/mbox-parser v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Mbox Parser

mbox-tparser is a really simple package to transform mbox files to js object.

Instalation

yarn add mbox-parser
# or
npm install mbox-parser

Example 1:

Get all mails in a mbox file

import { mboxParser } from "mbox-parser";

// here stream is a ReadStream to your mbox file
mboxParser(stream).then((mails) => {
  console.log(mails);
});

Example 2:

Get a specific page of a specific size in your mbox file

First page is at number 1

import { mboxParser } from "mbox-parser";

// here stream is a ReadStream to your mbox file
mboxParser(stream, {
  pageSize: 20, // Number of mail to return
  pageNumber: 4 // Index of the 'page' you want
}).then((mails) => {
  console.log(mails);
});
}