Streaming BSON parser with rudimentary MongoDB archive support.
$ npm i stream-bson
# or
$ yarn add stream-bson
const { createReadStream } = require('fs')
const StreamBSON = require('stream-bson')
createReadStream('...')
.pipe(new StreamBSON({ archive: true }))
.on('data', doc => {})
.on('finish', () => {})
.on('error', err => {})
- Proper exception handling / multistream support.
- MongoDB archives are not parsed properly. Assuming there is a BSON file in the archive, setting
archive
inStreamBSON
options will skip the archive header (until\x07_id
) and ignore the footer (via parsing error).