bson-transform-stream
v1.1.0
Published
A Node.js Transform stream for processing BSON data.
Downloads
118
Readme
BSON Transform Stream
A Node.js Transform stream for processing BSON data. This stream parses incoming binary BSON data and outputs JavaScript objects.
Installation
Install the package using npm:
npm install bson-transform-stream
Usage
import fs from "node:fs";
import BSONTransformStream from "bson-transform-stream";
const readStream = fs.createReadStream("data.bson");
const bsonStream = new BSONTransformStream();
readStream.pipe(bsonStream).on("data", (obj) => {
console.log(obj);
});
API
BSONTransformStream
Extends Node.js Transform
stream to process BSON data.
Constructor
new BSONTransformStream(options);
Parameters:
options
(optional): An object containing BSON deserialization options. See documentation for available options.
Events
data
: Emitted for each parsed BSON document as a JavaScript object.
License
MIT License
Author
Carlos Santos ([email protected])