bson-iterator
v1.0.0
Published
Create an iterator from a BSON stream
Downloads
19
Readme
bson-iterator
Create an iterator from a BSON stream.
BSON file can be huge and it may not be possible to load the buffer array in memory to directly parse the bson.
This project allows to bypass this limit by processing directly a BSON stream.
Installation
$ npm i bson-iterator
Usage
import { bonIterator } from 'bson-iterator';
import { join } from 'path';
import { createReadStream } from 'fs';
const readStream = createReadStream(join(__dirname, 'yourFile.bson'));
for await (const entry of bsonIterator(readStream)) {
console.log(entry);
}