package
Read mbox file as a stream
npm install mbox-readerGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Reads email messages from a MBOX file. Output is an async generator where messages are yielded one by one.
MboxReader supports very large (multi gigabyte) mbox files as messages are processed asynchronously.
NB! mboxcl2 formatted mbox files are not supported as MboxReader assumes From-munging.
First install the module from NPM:
$ npm install mbox-readernext import the mboxReader generator function into your script:
const { mboxReader } = require('mbox-reader');mboxReader(readableStream, [options]) -> async generatorWhere
false.Generator yields objects with the following properties:
false if date was not parseableExample
Example reads mbox file from standard input and writes messages to console.
const { mboxReader } = require('mbox-reader');
for await (let message of mboxReader(process.stdin)) {
console.log(message.returnPath);
console.log(message.time);
process.stdout.write(message.content);
}© 2020 - 2024 Postal Systems OÜ
Licensed under the MIT license.
Estimated unpacked size across 7 packages.
1.3 MB
Includes dependencies.