Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lmantw/binarion
A simple binary format for storing JavaScript objects.
https://github.com/lmantw/binarion
binary data decoding encoding format javascript
Last synced: 24 days ago
JSON representation
A simple binary format for storing JavaScript objects.
- Host: GitHub
- URL: https://github.com/lmantw/binarion
- Owner: LmanTW
- License: mit
- Created: 2024-06-30T03:38:13.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-06T11:50:34.000Z (4 months ago)
- Last Synced: 2024-10-11T06:43:24.258Z (about 1 month ago)
- Topics: binary, data, decoding, encoding, format, javascript
- Language: TypeScript
- Homepage:
- Size: 110 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Get Started |
Documentation |
Specification> [!WARNING]
> This project is still in it's early stages of development, so we may introduce some breaking changes to the API and the data format.# Binarion
[![Npm version](https://img.shields.io/npm/v/binarion)](https://www.npmjs.com/package/binarion) [![Npm downloads](https://img.shields.io/npm/dm/binarion)](https://www.npmjs.com/package/binarion) [![CodeFactor grade](https://img.shields.io/codefactor/grade/github/LmanTW/Binarion)](https://www.codefactor.io/repository/github/lmantw/binarion/)> [!IMPORTANT]
> Binarion is not a competitor to [JSON](https://zh.wikipedia.org/wiki/JSON), it is not faster or more compact than [JSON](https://zh.wikipedia.org/wiki/JSON) most of the time.Binarion is designed to store [JavaScript](https://en.wikipedia.org/wiki/JavaScript) objects that contain large [TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray). For most use cases, using [JSON](https://zh.wikipedia.org/wiki/JSON) will be faster and more compact, but for some niche use cases, Binarion can be a good choice.
* Store image pixel data with other information, like width and height.
* Store world data for 2D sandbox game. (width, height, chunks, blocks, etc...)
* ~~Store the state of [one million checkboxes](https://onemillioncheckboxes.com)~~.[Performance](https://github.com/LmanTW/Binarion/blob/main/Documents/Performance.md)
## Supported Data Formats
| Name | Corresponding JavaScript Object | Implemented |
| --- | --- | --- |
| None | `null`, `undefined` | ✅ |
| Boolean | `boolean` | ✅ |
| Integer | `number` | ✅ |
| Float | `float` | ❌ |
| String | `string` | ✅ |
| Array | `Array` | ✅ |
| BoolArray | | ❌ |
| UintArray | `Uint8Array`, `Uint16Array`, `Uint32Array` | ✅ |
| FloatArray | `Float32Array`, `Float64Array` | ❌ |
| Object | `Object` | ✅ |
| Map | `Map` | ✅ |
| Set | `Set` | ✅ |
| Function | `Function` | ❌ |