{"repo":"zbjornson/bson-to-json","free":true,"listed":false,"github":"https://github.com/zbjornson/bson-to-json","clone":"git clone https://github.com/zbjornson/bson-to-json.git","description":"Fast BSON to JSON string transcoder","language":"C++","stars":11,"topics":["bson","mongodb","nodejs","avx2","sse42","sse2","x86"],"license":"MIT","category":"databases-storage","readme_excerpt":"Directly and quickly converts a BSON buffer to a JSON string stored in a Buffer. Useful for sending MongoDB database query results to a client over JSON+HTTP. Benchmark with a 2500-element array of medium objects (9MB BSON): Method Time (ms) ------ --------: JSON.stringify(BSON.deserialize(arr)) 1 226.0 this, JS 39.7 this, portable C++ 20.6 this, SSE2 15.2 this, SSE4.2 11.5 this, AVX2 10.6 1 BSON.deserialize is the official MongoDB js-bson implementation. Installation The C++ implementations require a C++ compiler. See instructions here. If you do not have a C++ compiler, the slower JS version will be used. [!Warning] Please don't use the version on npm (ozonep-bson-to-json). Someone else published this module with changes that should not have been made. Usage new Transcoder(p?: PopulateInfo) Constructs a new Transcoder. p is an optional instance of the PopulateInfo class that is used for client-side joins. Transcoder#transcode(bson: Uint8Array): Buffer Transcodes a BSON document to a JSON string stored in a Buffer. Note that Buffers extend Uint8Array, so bson can be a Buffer instance. The output should be identical to JSON.stringify(BSON.deserialize(v)) , with two exceptions: 1. This module writes full-precision (64-bit signed) BSON Longs to the JSON buffer. This is valid because JSON does not specify a maximum numeric precision, but js-bson instead writes an object with low and high bits. 2. This module does more/better input bounds checking than js-bson, so this module may","default_branch":null,"files":null,"tree":[],"storefront":"/r/zbjornson","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/zbjornson/bson-to-json/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}