Narnia's Psychedelic Mushrooms
    Wondering what’s next for npm?Check out our public roadmap! »

    fliptable

    0.0.1 • Public • Published

    Build Status NPM version NPM dependencies

    fliptable

    A column oriented representation of your table will save you on average about 50% of bytes!

    Do your tables look like this in JSON?

    [
      {"name": "Anne", "age": 25, "city": "Stuttgart"},
      {"name": "Mike", "age": 33, "city": "London"},
      {"name": "Juli", "age": 27, "city": "Paris"}
    ]
    

    fliptable(table) flips a row oriented array of objects into

    {
      "name": ["Anne", "Mike", "Juli"],
      "age": [25, 33, 27],
      "city": ["Stuttgart", "London", "Paris"]
    }
    

    a column oriented object of arrays.

    Save 50%

    • A row oriented sample table is 449600 characters long using JSON.stringify(table).
    • If you apply fliptable(table) the JSON string is only 212382 long.

    => You saved more than 50% without losing any information!

    • And yoo can flip the table a second time and get exactly what you had before.

    => table = fliptable(fliptable(table))

    Keywords

    Install

    npm i fliptable

    DownloadsWeekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar