wgdfstrategy
Collection of strategies to convert complex data structures from one GDF ( generic data format ) to another GDF. You may use the module to serialize complex data structure to string or deserialize string back to the original data structure. Generic data f
Last updated 9 months ago by wandalen .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install wgdfstrategy 
SYNC missed versions from official npm registry.

wGdfStrategy Build Status Build Status

Collection of strategies to convert complex data structures from one GDF ( generic data format ) to another GDF. You may use the module to serialize complex data structure to string or deserialize string back to the original data structure. Generic data format ( GDF ) is a format of data structure designed with taking into account none unique feature of data so that it is applicable to any kind of data.

Try out

npm install
node sample/Sample.s

Usage:

Example #1
/* How to convert data using bson format */

/* select encoder */

var serialize = _.Gdf.Select({ in : 'structure', ext : 'bson' });
serialize = serialize[ 0 ];

/* select decoder */

var deserialize = _.Gdf.Select({ in : 'buffer.node', ext : 'bson' });
deserialize = deserialize[ 0 ];

/* encode */

var structure = { field : 'value' };
var serialized =  serialize.encode({ data : structure });

console.log( serialized.data );

//<Buffer 16 00 00 00 02 66 69 65 6c 64 00 06 00 00 00 76 61 6c 75 65 00 00>

/* decode */

var deserialized = deserialize.encode({ data : serialized.data });

console.log( deserialized.data );

//{ field: 'value' }

Benchmarks

1Mb Structure:

┌───────────────┬───────────────┬───────────────┬───────────────┐
│   Converter   │   Out size    │  Write time   │   Read time   │
├───────────────┼───────────────┼───────────────┼───────────────┤
│     bson      │    1.3 Mb     │    0.065s     │    0.066s     │
│   json.fine   │    1.9 Mb     │    0.960s     │    0.010s     │
│     json      │   663.1 kb    │    0.009s     │    0.008s     │
│     cson      │    4.0 Mb     │    4.228s     │    8.747s     │
│      js       │    1.9 Mb     │    0.597s     │    0.045s     │
│     cbor      │   426.9 kb    │    0.143s     │    0.141s     │
│      yml      │   765.4 kb    │    0.064s     │    0.051s     │
│  msgpack.lite │   428.7 kb    │    0.025s     │    0.032s     │
│  msgpack.wtp  │   428.7 kb    │    0.039s     │    0.025s     │
└───────────────┴───────────────┴───────────────┴───────────────┘

More details about converters perfomance.

Level of Support of Types

Information about level of support of each data type by each converter an be found here.

Current Tags

  • 0.3.155                                ...           alpha (8 days ago)
  • 0.3.146                                ...           beta (a month ago)
  • 0.3.152                                ...           gamma (a month ago)
  • 0.3.43                                ...           latest (9 months ago)

140 Versions

  • 0.3.155                                ...           8 days ago
  • 0.3.154                                ...           21 days ago
  • 0.3.153                                ...           a month ago
  • 0.3.152                                ...           a month ago
  • 0.3.151                                ...           a month ago
  • 0.3.150                                ...           a month ago
  • 0.3.149                                ...           a month ago
  • 0.3.148                                ...           a month ago
  • 0.3.147                                ...           a month ago
  • 0.3.146                                ...           a month ago
  • 0.3.145                                ...           a month ago
  • 0.3.144                                ...           a month ago
  • 0.3.143                                ...           a month ago
  • 0.3.142                                ...           a month ago
  • 0.3.141                                ...           a month ago
  • 0.3.140                                ...           a month ago
  • 0.3.139                                ...           a month ago
  • 0.3.138                                ...           a month ago
  • 0.3.137                                ...           a month ago
  • 0.3.136                                ...           2 months ago
  • 0.3.135                                ...           2 months ago
  • 0.3.134                                ...           2 months ago
  • 0.3.133                                ...           2 months ago
  • 0.3.132                                ...           2 months ago
  • 0.3.131                                ...           2 months ago
  • 0.3.130                                ...           2 months ago
  • 0.3.129                                ...           2 months ago
  • 0.3.128                                ...           2 months ago
  • 0.3.127                                ...           2 months ago
  • 0.3.126                                ...           2 months ago
  • 0.3.125                                ...           2 months ago
  • 0.3.124                                ...           2 months ago
  • 0.3.123                                ...           2 months ago
  • 0.3.122                                ...           2 months ago
  • 0.3.121                                ...           2 months ago
  • 0.3.120                                ...           2 months ago
  • 0.3.119                                ...           2 months ago
  • 0.3.118                                ...           2 months ago
  • 0.3.117                                ...           2 months ago
  • 0.3.116                                ...           2 months ago
  • 0.3.115                                ...           3 months ago
  • 0.3.114                                ...           3 months ago
  • 0.3.113                                ...           3 months ago
  • 0.3.112                                ...           3 months ago
  • 0.3.111                                ...           3 months ago
  • 0.3.110                                ...           3 months ago
  • 0.3.109                                ...           3 months ago
  • 0.3.108                                ...           3 months ago
  • 0.3.107                                ...           3 months ago
  • 0.3.106                                ...           3 months ago
  • 0.3.105                                ...           3 months ago
  • 0.3.104                                ...           3 months ago
  • 0.3.103                                ...           3 months ago
  • 0.3.102                                ...           3 months ago
  • 0.3.101                                ...           4 months ago
  • 0.3.100                                ...           4 months ago
  • 0.3.99                                ...           4 months ago
  • 0.3.98                                ...           4 months ago
  • 0.3.97                                ...           4 months ago
  • 0.3.96                                ...           4 months ago
  • 0.3.95                                ...           4 months ago
  • 0.3.94                                ...           4 months ago
  • 0.3.93                                ...           4 months ago
  • 0.3.92                                ...           4 months ago
  • 0.3.91                                ...           4 months ago
  • 0.3.90                                ...           4 months ago
  • 0.3.89                                ...           4 months ago
  • 0.3.88                                ...           4 months ago
  • 0.3.87                                ...           4 months ago
  • 0.3.86                                ...           4 months ago
  • 0.3.85                                ...           5 months ago
  • 0.3.84                                ...           5 months ago
  • 0.3.83                                ...           5 months ago
  • 0.3.82                                ...           5 months ago
  • 0.3.81                                ...           5 months ago
  • 0.3.80                                ...           5 months ago
  • 0.3.78                                ...           5 months ago
  • 0.3.77                                ...           5 months ago
  • 0.3.76                                ...           6 months ago
  • 0.3.75                                ...           6 months ago
  • 0.3.74                                ...           6 months ago
  • 0.3.73                                ...           6 months ago
  • 0.3.72                                ...           6 months ago
  • 0.3.71                                ...           6 months ago
  • 0.3.70                                ...           6 months ago
  • 0.3.69                                ...           6 months ago
  • 0.3.68                                ...           6 months ago
  • 0.3.67                                ...           6 months ago
  • 0.3.66                                ...           6 months ago
  • 0.3.65                                ...           6 months ago
  • 0.3.64                                ...           6 months ago
  • 0.3.63                                ...           6 months ago
  • 0.3.62                                ...           6 months ago
  • 0.3.61                                ...           6 months ago
  • 0.3.60                                ...           6 months ago
  • 0.3.59                                ...           7 months ago
  • 0.3.58                                ...           7 months ago
  • 0.3.44                                ...           7 months ago
  • 0.3.43                                ...           9 months ago
  • 0.3.42                                ...           9 months ago
  • 0.3.41                                ...           9 months ago
  • 0.3.40                                ...           10 months ago
  • 0.3.39                                ...           10 months ago
  • 0.3.38                                ...           10 months ago
  • 0.3.37                                ...           10 months ago
  • 0.3.36                                ...           10 months ago
  • 0.3.35                                ...           10 months ago
  • 0.3.34                                ...           a year ago
  • 0.3.33                                ...           a year ago
  • 0.3.32                                ...           a year ago
  • 0.3.31                                ...           a year ago
  • 0.3.30                                ...           a year ago
  • 0.3.29                                ...           a year ago
  • 0.3.28                                ...           a year ago
  • 0.3.27                                ...           a year ago
  • 0.3.26                                ...           a year ago
  • 0.3.25                                ...           a year ago
  • 0.3.24                                ...           a year ago
  • 0.3.23                                ...           a year ago
  • 0.3.22                                ...           a year ago
  • 0.3.21                                ...           a year ago
  • 0.3.20                                ...           a year ago
  • 0.3.18                                ...           a year ago
  • 0.3.17                                ...           a year ago
  • 0.3.16                                ...           a year ago
  • 0.3.15                                ...           a year ago
  • 0.3.14                                ...           a year ago
  • 0.3.13                                ...           a year ago
  • 0.3.12                                ...           a year ago
  • 0.3.11                                ...           a year ago
  • 0.3.10                                ...           a year ago
  • 0.3.9                                ...           a year ago
  • 0.3.8                                ...           a year ago
  • 0.3.7                                ...           a year ago
  • 0.3.6                                ...           a year ago
  • 0.3.5                                ...           a year ago
  • 0.3.4                                ...           a year ago
  • 0.3.3                                ...           a year ago
  • 0.3.2                                ...           a year ago
  • 0.3.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1,394
Last Day 0
Last Week 296
Last Month 2,061
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |