Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thekorn/bson-deno
port of js-bson to deno
https://github.com/thekorn/bson-deno
Last synced: about 2 months ago
JSON representation
port of js-bson to deno
- Host: GitHub
- URL: https://github.com/thekorn/bson-deno
- Owner: thekorn
- Created: 2022-07-10T09:18:45.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-24T10:28:36.000Z (about 2 years ago)
- Last Synced: 2023-08-08T20:43:33.954Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://deno.land/x/bson_deno
- Size: 186 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bson-deno
![Deno](https://github.com/thekorn/bson-deno/actions/workflows/deno.yml/badge.svg)
**Note: this is in a highly experimental state**
Port of the [js-bson](https://github.com/mongodb/js-bson.git) library to deno,
with the goal of feature compatibility and completeness with upstream.This port has been autogenerated from the upstream `js-bson` by this
[build tool](https://github.com/thekorn/deno-build-mongodb-native) - please
don't make any manual changes to this repository, esp to `./_src` and report any
bugs either to the build tool, or even
[upstream](https://github.com/mongodb/js-bson)## Usage
Simple example
```typescript
import * as BSON from 'https://deno.land/x/[email protected]/mod.ts';
const Long = BSON.Long;// Serialize a document
const doc = { long: Long.fromNumber(100) };
const data = BSON.serialize(doc);
console.log('data:', data);// Deserialize the resulting Buffer
const doc_2 = BSON.deserialize(data);
console.log('doc_2:', doc_2);
```## known issues
- [ ] types cannot be initialized as function calls
- [ ] the `BSON.Timestamp` type has a broken initializer
- [ ] Buffer serialization is broken
- [ ] we have a few skipped test cases