All Projects → Simonwep → nason

Simonwep / nason

Licence: MIT license
🗜 Ultra tiny serializer / encoder with plugin-support. Useful to build binary files containing images, strings, numbers and more!

Programming Languages

typescript
32286 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to nason

NBT
A java implementation of the NBT protocol, including a way to implement custom tags.
Stars: ✭ 128 (+326.67%)
Mutual labels:  serialization, compression, deserialization
Borer
Efficient CBOR and JSON (de)serialization in Scala
Stars: ✭ 131 (+336.67%)
Mutual labels:  serialization, binary, deserialization
Fspickler
A fast multi-format message serializer for .NET
Stars: ✭ 299 (+896.67%)
Mutual labels:  serialization, binary, bson
Noproto
Flexible, Fast & Compact Serialization with RPC
Stars: ✭ 138 (+360%)
Mutual labels:  serialization, deserialization, bson
Beeschema
Binary Schema Library for C#
Stars: ✭ 46 (+53.33%)
Mutual labels:  serialization, binary, deserialization
parco
🏇🏻 generalist, fast and tiny binary parser and compiler generator, powered by Go 1.18+ Generics
Stars: ✭ 57 (+90%)
Mutual labels:  serialization, binary, deserialization
GenericProtocol
⚡️ A fast TCP event based buffered server/client protocol for transferring data over the (inter)net in .NET 🌐
Stars: ✭ 38 (+26.67%)
Mutual labels:  serialization, binary
Qs
Quick serialization of R objects
Stars: ✭ 225 (+650%)
Mutual labels:  serialization, compression
Jsonapi Rails
Rails gem for fast jsonapi-compliant APIs.
Stars: ✭ 242 (+706.67%)
Mutual labels:  serialization, deserialization
marshmallow-validators
Use 3rd-party validators (e.g. from WTForms and colander) with marshmallow
Stars: ✭ 24 (-20%)
Mutual labels:  serialization, deserialization
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (+593.33%)
Mutual labels:  serialization, deserialization
avro-serde-php
Avro Serialisation/Deserialisation (SerDe) library for PHP 7.3+ & 8.0 with a Symfony Serializer integration
Stars: ✭ 43 (+43.33%)
Mutual labels:  serialization, deserialization
har-rs
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.
Stars: ✭ 25 (-16.67%)
Mutual labels:  serialization, deserialization
avrow
Avrow is a pure Rust implementation of the avro specification https://avro.apache.org/docs/current/spec.html with Serde support.
Stars: ✭ 27 (-10%)
Mutual labels:  serialization, deserialization
Jsonapi Rb
Efficiently produce and consume JSON API documents.
Stars: ✭ 219 (+630%)
Mutual labels:  serialization, deserialization
Schematics
Project documentation: https://schematics.readthedocs.io/en/latest/
Stars: ✭ 2,461 (+8103.33%)
Mutual labels:  serialization, deserialization
sqlathanor
Serialization / De-serialization support for the SQLAlchemy Declarative ORM
Stars: ✭ 105 (+250%)
Mutual labels:  serialization, deserialization
json struct
json_struct is a single header only C++ library for parsing JSON directly to C++ structs and vice versa
Stars: ✭ 279 (+830%)
Mutual labels:  serialization, deserialization
bytes
Work with bytes and implement network protocols
Stars: ✭ 77 (+156.67%)
Mutual labels:  serialization, deserialization
sexp-grammar
Invertible parsing for S-expressions
Stars: ✭ 28 (-6.67%)
Mutual labels:  serialization, deserialization

Logo

Ultra tiny object serializer

gzip size brotli size Coverage Status Build Status Download count No dependencies JSDelivr download count Current version Support me

Disclaimer: This library is part of a bigger project and its goal is to be as small as possible (I don't want to use the >200kb bundle of bson). This lib is only around 4kb, uncompressed. It's only supposed to work within JS itself and not all data-types are implemented so far (see types-table at the bottom).

The name is based on nashorn which is the German word for rhino.

Installation

Install via npm or yarn:

$ npm install nason
# or
$ yarn add nason

Include directly via jsdelivr:

<script src="https://cdn.jsdelivr.net/npm/nason/lib/nason.min.js"></script>

Using JavaScript Modules:

import {

...
}
from
'https://cdn.jsdelivr.net/npm/nason/lib/nason.min.mjs'

Usage

import {deserialize, serialize} from 'nason';

// Serialize something; you'll get a Uint8Array in return.
// You can pass any kind of supported data-type you want to serialize.
const enc = serialize({
    'hello': 'world',
    'number': 13235,
    'array': [1, 2, 3, 'abc']
});

// ... save enc to file or do whatever you want with it

// Deserialize a previously-serialized value
const dec = deserialize(enc);
console.log(dec); // Will be the same as initially passed into serialize

nason exports the following properties and functions:

import {
    deserialize, // Takes a single Uint8Array and decodes it
    serialize, // Takes any supported value and converts it to a Uint8Array
    version // Current version of this package
} from 'nason';

There's even more if you want to develop plugins!

Data-types

Data-type Status
object Fully supported
array Fully supported
string Fully supported
number Fully supported
boolean Fully supported
null Fully supported

undefined is not part of the JSON specification and will throw an error if you try to serialize it. You can, however, add support for it ;)

Plugins

It's possible to write custom encoders for data-types not supported out-of-the-box. Head to plugins to get started!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].