1.0.0 • Published 2 years ago

bson-iterator v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

bson-iterator

NPM version build status Test coverage npm download

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

MIT