mboxcl

1.0.1 • Public • Published

node-mboxcl

Content-Length aware mbox reader

The aim of this code is to produce an index of an mbox file that can be used to quickly read messages at random. It takes advantage of Content-Length headers to make its way through large mbox files quickly. Messages without Content-Length headers will force the code to scan for the next "\nFrom ". No provision is made for unquoting ">From " in the message bodies. Message header information is emitted as messages are encountered to allow for responsive UI design. Streamed input is not supported since an index into a stream is not useful. Conversely, alternative fs modules can theoretically be provided.

const Mbox = require('mboxcl')
 
let mbox = new Mbox('filename') // or fd
mbox.on('message', ({pos, headers, headerLength, contentLength, length})=>{})
mbox.on('done', ()=>{
  let messageDataArray = mbox.index
})
mbox.on('err', err=>{})
mbox.on('log', msg=>{})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i mboxcl

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • hikingpete