项目作者: karimsa

项目描述 :
Rapid & secure communications module.
高级语言: JavaScript
项目地址: git://github.com/karimsa/fldsmdfr.git
创建时间: 2017-03-08T05:17:48Z
项目社区:https://github.com/karimsa/fldsmdfr

开源协议:MIT License

下载



(pretty picture)


fldsmdfr









Strongly typed JSON.

About

JSON is great for humans, sucks for storage. This tool is tasked at forcing APIs to strongly
type the parameters for their endpoints. This allows fldsmdfr to optimize all data sent over
the network in terms of space.

Usage

Install via npm i --save fldsmdfr.

Two methods: BJSON.stringify() & BJSON.parse() - designed to be as similar to the native
JSON.* methods as possible. The only difference is that it will required an extra parameter
which should be a type mapping.

Examples

  1. BJSON.stringify({ msg: 'Hello, world' }, { msg: 'string' }) // returns a Buffer
  1. BJSON.parse(`<Buffer ...>`, { msg: 'string' }) // returns: { msg: 'Hello, world' }

License

Licensed under MIT license.

Copyright © 2017-present Karim Alibhai.