Skip to content

d4data-official/mbox-to-json

Repository files navigation

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);
});
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •