npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wgdf

v0.3.338

Published

Standardized abstract interface and collection of strategies to convert complex data structures from one generic data format ( GDF ) to another generic data format. You may use the module to serialize complex data structure to string or deserialize string

Downloads

3,990

Readme

module::Gdf status stable

Standardized abstract interface and collection of strategies to convert complex data structures from one generic data format ( GDF ) to another generic data format. 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 from the repository

git clone https://github.com/Wandalen/wGdf
cd wGdf
will .npm.install
node sample/trivial/Sample.s

Make sure you have utility willbe installed. To install willbe: npm i -g willbe@stable. Willbe is required to build of the module.

To add to your project

npm add 'wgdf@stable'

Willbe is not required to use the module in your project as submodule.

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.