@loaders.gl/bson
Version:
Framework-independent loader for JSON and streaming JSON formats
24 lines (23 loc) • 683 B
JavaScript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import { encodeBSONSync } from "./lib/encoders/encode-bson.js";
// __VERSION__ is injected by babel-plugin-version-inline
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const VERSION = typeof "4.3.3" !== 'undefined' ? "4.3.3" : 'latest';
export const BSONWriter = {
name: 'BSON',
id: 'bson',
module: 'bson',
version: VERSION,
extensions: ['bson'],
options: {
bson: {}
},
async encode(data, options) {
return encodeBSONSync(data, {}); // options
},
encodeSync(data, options) {
return encodeBSONSync(data, {}); // options
}
};