2.2.1 • Published 6 years ago

binary-transfer v2.2.1

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

binary-transfer

Travel your data very fast using binary serialization.

This project is based on Telegram Type Language.

About the project

The aim of this project is:

  • A very small library that can travel data very fast
  • A scheme of how your data looks like to increase productivity between teams
  • To create a data model that can be easily be understood, changed or mantained

Schema

Account account -> id: int, username: string, email: string;

Usage

import { Schema, language } from 'binary-transfer';

const parser = new language.SchemaParser();
const schema = new Schema([
    {containers: parser.parse(`
        type Account {
            account -> id: int,
                        username: string,
                        email: string,
                        posts: Vector<Post>
        }
        type Post {
            post -> id: int,
                    title: string,
                    body: string
        }
    `)}
]);

const buffer = schema.encode('account', {
    id: 3,
    username: '',
    email: '',
    posts: []
});

assert.deepEqual(schema.decode(buffer), {
    id: 3,
    username: '',
    email: '',
    posts: [{
        id: 100,
        title: 'This is my first post',
        body: 'Empty body, please edit it',
        _name: 'post',
        _type: 'Post',
        _traits: []
    }],
    _name: 'account',
    _type: 'Account',
    _traits: []
});

Testing

git clone https://github.com/VictorQueiroz/binary-transfer
cd binary-transfer/
npm install
make test
2.2.1

6 years ago

2.2.0

6 years ago

2.1.9

6 years ago

2.1.8

6 years ago

2.1.7

6 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.4.9

7 years ago

1.4.8

7 years ago

1.4.7

7 years ago

1.4.6

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.8

7 years ago

1.3.7

7 years ago

1.3.6

7 years ago

1.3.5

7 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.7

7 years ago

1.1.63

7 years ago

1.1.61

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago