1.0.0 • Published 2 years ago
bson-iterator v1.0.0
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);
}
API Documentation
License
1.0.0
2 years ago