0.1.19 • Published 4 years ago

json-deflate v0.1.19

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

json-deflate

Shrink JSON data lenght by extracting property names with shorter ones. It is particularly efficent against a large heterogeneous collection.

NPM version

Installation

npm install json-deflate

Examples

import { deflate, restore } from 'json-deflater';

const originalData = [{
  "id": 1,
  "firstName": "Hazlett",
  "lastName": "Rapley",
  "email": "hrapley0@apple.com",
  "homeAddressLine": "91 Veith Lane",
  "homeAddressCity": "Atlanta",
  "homeAddressState": "Georgia",
  "homeAddressZip": "31132"
}, {
  "id": 2,
  "firstName": "Madalena",
  "lastName": "Joint",
  "email": "mjoint1@multiply.com",
  "homeAddressLine": "2 Gerald Court",
  "homeAddressCity": "Nashville",
  "homeAddressState": "Tennessee",
  "homeAddressZip": "37235"
}, {
  "id": 3,
  "firstName": "Erich",
  "lastName": "Barfford",
  "email": "ebarfford2@virginia.edu",
  "homeAddressLine": "22887 Rigney Place",
  "homeAddressCity": "Lexington",
  "homeAddressState": "Kentucky",
  "homeAddressZip": "40515"
}, {
  "id": 4,
  "firstName": "Allison",
  "lastName": "Radin",
  "email": "aradin3@newsvine.com",
  "homeAddressLine": "453 Sage Terrace",
  "homeAddressCity": "Columbus",
  "homeAddressState": "Georgia",
  "homeAddressZip": "31904"
}, {
  "id": 5,
  "firstName": "Rouvin",
  "lastName": "Pulsford",
  "email": "rpulsford4@odnoklassniki.ru",
  "homeAddressLine": "25 Scofield Terrace",
  "homeAddressCity": "Fresno",
  "homeAddressState": "California",
  "homeAddressZip": "93786"
}];

const compressedData = deflate(originalData);

const restoredData = deflate(originalData);
0.1.19

4 years ago

0.1.18

4 years ago

0.1.7

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago