All Projects → weisrc → sirdez

weisrc / sirdez

Licence: MIT license
Glorious Binary Serialization and Deserialization for TypeScript.

Programming Languages

typescript
32286 projects
shell
77523 projects

Projects that are alternatives of or similar to sirdez

Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (+560%)
Mutual labels:  serialization, ipc, protocol, rpc
Binary
Generic and fast binary serializer for Go
Stars: ✭ 86 (+330%)
Mutual labels:  encoding, serialization, binary, decoding
Pbf
A low-level, lightweight protocol buffers implementation in JavaScript.
Stars: ✭ 618 (+2990%)
Mutual labels:  encoding, serialization, binary, decoding
Protobuf
Protocol Buffers - Google's data interchange format
Stars: ✭ 52,305 (+261425%)
Mutual labels:  serialization, marshalling, rpc
Ceras
Universal binary serializer for a wide variety of scenarios https://discord.gg/FGaCX4c
Stars: ✭ 374 (+1770%)
Mutual labels:  serialization, binary, protocol
Fastbinaryencoding
Fast Binary Encoding is ultra fast and universal serialization solution for C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift
Stars: ✭ 421 (+2005%)
Mutual labels:  serialization, binary, protocol
sia
Sia - Binary serialisation and deserialisation
Stars: ✭ 52 (+160%)
Mutual labels:  encoding, serialization, binary
Binaryserializer
A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
Stars: ✭ 197 (+885%)
Mutual labels:  serialization, binary, protocol
Scodec
Scala combinator library for working with binary data
Stars: ✭ 709 (+3445%)
Mutual labels:  encoding, binary, decoding
Bitmatch
A Rust crate that allows you to match, bind, and pack the individual bits of integers.
Stars: ✭ 82 (+310%)
Mutual labels:  encoding, binary, decoding
Phpasn1
A PHP library to encode and decode arbitrary ASN.1 structures using ITU-T X.690 encoding rules.
Stars: ✭ 136 (+580%)
Mutual labels:  encoding, binary, decoding
Flatbuffers
FlatBuffers: Memory Efficient Serialization Library
Stars: ✭ 17,180 (+85800%)
Mutual labels:  serialization, marshalling, rpc
GenericProtocol
⚡️ A fast TCP event based buffered server/client protocol for transferring data over the (inter)net in .NET 🌐
Stars: ✭ 38 (+90%)
Mutual labels:  serialization, binary, protocol
Bincode
A binary encoder / decoder implementation in Rust.
Stars: ✭ 1,100 (+5400%)
Mutual labels:  encoding, serialization, binary
Jsonlab
JSONLab: a native JSON/UBJSON/MassagePack encoder/decoder for MATLAB/Octave
Stars: ✭ 202 (+910%)
Mutual labels:  encoding, serialization, decoding
metacom
RPC communication protocol for Metarhia stack 🔌
Stars: ✭ 42 (+110%)
Mutual labels:  ipc, protocol, rpc
go-webp
Simple and fast webp library for golang
Stars: ✭ 91 (+355%)
Mutual labels:  encoding, decoding
ronin-support
A support library for Ronin. Like activesupport, but for hacking!
Stars: ✭ 23 (+15%)
Mutual labels:  encoding, binary
d3coder
Chrome extension for encoding/decoding and hashing text on websites
Stars: ✭ 26 (+30%)
Mutual labels:  encoding, decoding
Apex.Serialization
High performance contract-less binary serializer for .NET
Stars: ✭ 82 (+310%)
Mutual labels:  serialization, binary

Sir Dez

Glorious SerDes for TypeScript

The library you can rely on,
For binary serialization and deserialization,
In Node, Deno, and the Web environment,
Which is simple and yet performant.

npm deno ci coverage report docs perf bundle

Features

  • Performant
  • Easy to use
  • Full TypeScript support
  • Super extensible
  • 99% tree-shakable
  • Zero dependencies (small footprint)
  • Runs in Node, Deno and browsers
  • More details...

Performance Comparison with other tools in Node (ops/sec)

performance

Installation

Expand for more details.

Node (with or without bundlers)

In the terminal with NPM

npm i sirdez

Or with Yarn

yarn add sirdez

In the code with ES Modules

import * as sd from "sirdez";

or with CommonJS

const sd = require("sirdez");
Web (without bundlers)

In HTML with UMD

<script src="https://cdn.jsdelivr.net/npm/sirdez/dist/sirdez.umd.js"></script>

In an ES module script (statically)

import * as sd from "https://cdn.jsdelivr.net/npm/sirdez/dist/sirdez.es.js";

In an ES module script (dynamically)

const sd = await import(
  "https://cdn.jsdelivr.net/npm/sirdez/dist/sirdez.es.js"
);
Deno

In code (statically)

import * as sd from "https://deno.land/x/sirdez/mod.ts";

In code (dynamically)

const sd = await import("https://deno.land/x/sirdez/mod.ts");

Usage

Creating a simple SerDes.

const person = sd.use(
  sd.struct({
    name: sd.string(sd.utf8, sd.uint8),
    age: sd.uint8
  })
);

const bytes = person.toBytes({
  name: "Bob",
  age: 23
});

const samePerson = person.fromBytes(bytes);

console.log({ bytes, samePerson });

Using TypeScript utilities

type Person = sd.GetType<typeof person>;

const bob: Person = {
  name: "Bob",
  age: 23
};

Resources

Contribution

Help and suggestions are welcomed!

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].