All Projects → node-modules → serialize-json

node-modules / serialize-json

Licence: MIT license
A serialize algorithm for JSON

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to serialize-json

dataclasses-jsonschema
JSON schema generation from dataclasses
Stars: ✭ 145 (+559.09%)
Mutual labels:  serialization
MetaCPP
C++ Reflection & Serialization using Clang's LibTooling
Stars: ✭ 44 (+100%)
Mutual labels:  serialization
json-strictify
Safely serialize a value to JSON without unintended loss of data or going into an infinite loop due to circular references.
Stars: ✭ 14 (-36.36%)
Mutual labels:  serialization
kafka-protobuf-serde
Serializer/Deserializer for Kafka to serialize/deserialize Protocol Buffers messages
Stars: ✭ 52 (+136.36%)
Mutual labels:  serialization
desert
Deserialize to objects while staying DRY
Stars: ✭ 136 (+518.18%)
Mutual labels:  serialization
typical
Data interchange with algebraic data types.
Stars: ✭ 114 (+418.18%)
Mutual labels:  serialization
CodableWrapper
@codec("encoder", "decoder") var cool: Bool = true
Stars: ✭ 143 (+550%)
Mutual labels:  serialization
tyson
A TypeScript serialization/deserialization library to convert objects to/from JSON
Stars: ✭ 25 (+13.64%)
Mutual labels:  serialization
vue-query-builder
A Vue-Query-Builder
Stars: ✭ 71 (+222.73%)
Mutual labels:  serialization
JsonFormatter
Easy, Fast and Lightweight Json Formatter. (Serializer and Deserializer)
Stars: ✭ 26 (+18.18%)
Mutual labels:  serialization
drf-action-serializer
A serializer for the Django Rest Framework that supports per-action serialization of fields.
Stars: ✭ 48 (+118.18%)
Mutual labels:  serialization
Bois
Salar.Bois is a compact, fast and powerful binary serializer for .NET Framework. With Bois you can serialize your existing objects with almost no change.
Stars: ✭ 53 (+140.91%)
Mutual labels:  serialization
ikeapack
Compact data serializer/packer written in Go, intended to produce a cross-language usable format.
Stars: ✭ 18 (-18.18%)
Mutual labels:  serialization
doku
fn(Code) -> Docs
Stars: ✭ 65 (+195.45%)
Mutual labels:  serialization
HashStablePack
Serialization code generator for QUICK struct content comparison
Stars: ✭ 94 (+327.27%)
Mutual labels:  serialization
VSerializer
A library to serialize and deserialize objects with minimum memory usage.
Stars: ✭ 25 (+13.64%)
Mutual labels:  serialization
succinct-binary
Succinct binary serialization
Stars: ✭ 16 (-27.27%)
Mutual labels:  serialization
use-query-string
🆙 A React hook that serializes state into the URL query string
Stars: ✭ 50 (+127.27%)
Mutual labels:  serialization
sirdez
Glorious Binary Serialization and Deserialization for TypeScript.
Stars: ✭ 20 (-9.09%)
Mutual labels:  serialization
SwiftCBOR
A CBOR implementation for Swift
Stars: ✭ 95 (+331.82%)
Mutual labels:  serialization

serialize-json

A serialize algorithm for JSON

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Introduction

  • Support serialize JSON to Buffer, and deserialize Buffer to JSON

    • [√] Boolean
    • [√] String
    • [√] Number
    • [√] Null
    • [√] Undefined
    • [√] Date
    • [√] Buffer
    • [√] Error
    • [√] Plain Object
    • [×] Function
    • [×] RegExp
    • [×] Symbol
  • Inspire by jsonpack, it can compress to 55% of original size if the data has a recursive structure

Install

$ npm install serialize-json --save

Node.js >= 4.0.0 required

Usage

let json = {
  a: 'a',
  b: 123,
  c: 123.456,
  d: [ 1, 2, 3 ],
  e: true,
  f: null,
  g: undefined,
  h: new Date(),
  i: new Buffer('this is a buffer'),
  j: new Error('this is a error'),
};
const buf = JSON.encode(json);
const result = JSON.decode(buf);
assert.deepEqual(result, json);

API

  • encode(json) serialize a json object
  • decode(buf) deserialize a buffer to json
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].