An utility library for Encoding and Compressing whatever you give him into a small string.

Overview

🟢 ORBIT ENCODER ⚙️ 🗜️

Compatible Status Code Size Status Commit Status Issues Status npm version license

ORBIT-ENCODER is an utility library for Data Compression and Encoding. It can take whatever object you give him as argument and returns a compressed encoded string. It provides a decoding method too. It uses a modified version of LZString for UTF16 Compression.

ORBIT-ENCODER COVER

INSTALLATION



📚 Table Of Contents 📑


💨 What is this Library for? 🤔

ORBIT-ENCODER is a small library that is useful for Encoding Objects [String, Arrays, JSON, Anything...] to a Compressed UTF16 String. You can also Decode that string back using The exposed Decode method.

Note: This library can only be used with JS or TS but you already know that 🤦🏿‍♂️.

Key Features 🎯

  • Use it without Instanciation because all the methods are Static.
  • Fast and High Performance Compression of big Complex Data.
  • TOO EASY TO USE !! 🥳 🥳

📥 HOW TO RUN IT ? 🔰

# installation with npm
npm install array-querier

# or you may prefer
npm i --save array-querier

# installation with yarn
yarn add array-querier

This SCRIPT relies on NOTHING SO YOU DON'T NEED ADDITIONNAL PACKAGES.


🤔 HOW IT WORKS ? 🤔

You only need to Import the OrbitEncoder Class from the Package and start using it !

➤ Encode & Decode Given Data 🟢

If you have a User object as follows ->

const User = {
    "name": "Orbit",
    "age": 21,
    "planet": {
        "id": 4,
        "codename" : "Shadow-Coders",
        "galaxyName" : "Turner"
    }   
}

👇🏾 Let's Encode and Decode an Objects :

  • ECMAScript Modules and Typescript
    import {OrbitEncoder} from 'orbit-encoder/lib/OrbitEncoder';

    // Then Encode whatever you want
    const encodedData = OrbitEncoder.encode(User);

    console.log(encodedData);
    /**
     * 👇🏾 Output: 👇🏾
     * 
     * ᓢ㰴䅼ী甤〦恩Ìߐዠᔣᣡ䂦TɈ〦⁐䰠ᘡ㐢〪僠㲪␠祶fĂ࢕⓸Ǹ͚ࣣគⵉM䀼䀻什䁕㒘攈ᢸ᣷吰ৣ乩厖亰æၩ䩴¸椮ࠢ昤怪挑䃒塐恬睂⑘䤣&㉀PƘ䀠
     * 
     * /
    ...
    const decodedData = OrbitEncoder.decode(encodedData);

    console.log(decodedData);
    /**
     * 👇🏾 Output: 👇🏾
     * 
     * {
        name: 'Orbit',
        age: 21,
        planet: { id: 4, codename: 'Shadow-Coders', galaxyName: 'Turner' }
      }
     * 
     * /

🛑 ANGULAR & FRONTEND USERS ☢️

Note: If you are using this in your frontend application you'll need to add the folowing line in your index.html 👇🏾:.

    <script> if (global === undefined) { var global = window; } </script>

FIX COMING: We are working on Future updates that will try to fix this error [Uncaught ReferenceError: global is not defined].

  • CommonJs and Vailla JS
  const orbit = require("orbit-encoder").OrbitEncoder;

  const data = orbit.encode('Bodio Bodio Yei !!');

  console.log(data); // 🚀 Output :ᅢ汇njࢀ甠瀼橪梸恕<Ұᡠ⢠ୀ

  console.log(orbit.decode(data));

Note: * You can do that : const orbit = require("orbit-encoder"); And use orbit.OrbitEncoder.encode() everywhere but for a more clean approach I did the code above.

➤ Encode & Decode Data Passed on URI 🟢

Sometimes you may want to pass some heavy and complex data or datastructure in a URL, so you can use the encodeWithURIsafe method. It produces ASCII strings representing the original string encoded in Base64 with a few tweaks to make these URI safe. Hence, you can send them to the server without thinking about URL encoding them. This saves bandwidth and CPU.

  • ECMAScript Modules and Typescript
    import {OrbitEncoder} from 'orbit-encoder/lib/OrbitEncoder';

    const data = [['2021-03-02','2021-06-02'],['2022-05-05','2021-07-01']];

    // Then Encode whatever you want
    const encodedData = OrbitEncoder.encodeWithURIsafe(data);

    console.log(dataForURI);

    /**
     * 👇🏾 Output: 👇🏾
     * 
     * OoRgzglgsgVgggTygZQAwHcoI1CBJMPGPTGAUQBcoARATSurwgA1kAPAIyJNjwYFUBEADIBhPEkZthAFTgBmWXDZ4ANiAAmQA
     * 
     * /
    ...
    const decodedData = OrbitEncoder.decodeURIsafe(encodedData);

    console.log(decodedData);
    /**
     * 👇🏾 Output: 👇🏾
     * 
     * [ [ '2021-03-02', '2021-06-02' ], [ '2022-05-05', '2021-07-01' ] ]
     * 
     * /
  • CommonJs and Vanilla JS
  const orbit = require("orbit-encoder").OrbitEncoder;


  const dataForURI = orbit.encodeWithURIsafe([['2021-03-02','2021-06-02'],['2022-05-05','2021-07-01']]);

  console.log(dataForURI) // 🚀 Output : OoRgzglgsgVgggTygZQAwHcoI1CBJMPGPTGAUQBcoARATSurwgA1kAPAIyJNjwYFUBEADIBhPEkZthAFTgBmWXDZ4ANiAAmQA
  
  console.log(orbit.decodeURIsafe(dataForURI))

Configuration Options

Coming Soon !


Contributing

👋🏾 Pull requests are welcome!


Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.


GREETINGS


Author

Orbit Turner


License

This project is licensed under the MIT license. See the LICENSE file for more info.


MADE WITH LOVE

Image of OT

You might also like...

Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator Types generator is a utility tool that will help User to create TS Interfaces from JSON. All you have to do is paste your single objec

Dec 6, 2022

A small utility server to exchange data and messages between clients. Comes complete with E2E public key encryption

Zenotta Intercom A small utility server to exchange arbitrary data between clients. Comes complete with E2E public key encryption Official documentati

Oct 2, 2022

A small library for turning RSS XML feeds into JavaScript objects

rss-parser A small library for turning RSS XML feeds into JavaScript objects. Installation npm install --save rss-parser Usage You can parse RSS from

Dec 31, 2022

A utility for creating toggleable items with JavaScript. Inspired by bootstrap's toggle utility. Implemented in vanillaJS in a functional style.

LUX TOGGLE Demo: https://jesschampion.github.io/lux-toggle/ A utility for creating toggleable dom elements with JavaScript. Inspired by bootstrap's to

Oct 3, 2020

A small CLI utility to configure Japa inside an existing Node.js project

A small CLI utility to configure Japa inside an existing Node.js project

Mar 11, 2022

Statistics plugin for RemNote that will give you some helpful numbers, charts and heatmap for your knowledge base.

RemNote statistics plugin Features This plugin will give you the following statistics: Retention rate Number of cards due in future Type of buttons yo

Sep 9, 2022

Make your first Pull Request on Hacktoberfest 2022. Don't forget to spread love and if you like give us a star

Make your first Pull Request on Hacktoberfest 2022. Don't forget to spread love and if you like give us a star

Hacktoberfest2022 Make your first Pull Request on Hacktoberfest 2022. Don't forget to spread love and if you like give us a star Quality of Pull Reque

Oct 30, 2022

A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

A string of four operations of the library, can solve the js digital calculation accuracy of scientific notation and formatting problems, support for thousands of decimal point formatting output operations

Apr 6, 2022

Little Javascript / Typescript library for validating format of string like email, url, password...

String-Validators Little Javascript / Typescript library for validating format of string like email, url, password... Signaler un Bug · Proposer une F

Oct 14, 2022
Comments
  • More details in README

    More details in README

    Is your feature request related to a problem? Please describe. It's not really clear what compression algo is used and what's it's performance.

    Describe the solution you'd like A clear readme with the algo used, why it was chosen and how it compares to other algorithms / libraries. After testing with my demo dataset this lib is really slow on compression and super fast on decompression. I'm searching for something that will be fast both ways and it would be nice to cross out a lib at first glance without testing :P.

    Describe alternatives you've considered ZLib, LZ77, LZW, Zip, probably others.

    opened by zamber 2
Releases(ORBIT-ENCODER-V1)
Owner
Orbit Turner
FullStack DevOps | Angular / NestJS & WordPress Lover | Truth Teller • Designer & Entrepreneur 🚀 MOONWALKER 🚀
Orbit Turner
ltp is a parseless copyfree binary encoding format

ltp is a parseless copyfree binary encoding format. This means that you can read a field out of ltp encoded data without

Socket Supply Co. 27 Aug 10, 2022
A small javascript DOM manipulation library based on Jquery's syntax. Acts as a small utility library with the most common functions.

Quantdom JS Quantdom is a very small (about 600 bytes when ran through terser & gzipped) dom danipulation library that uuses a Jquery like syntax and

Sean McQuaid 7 Aug 16, 2022
MSP Sentry Open Source repository. Integrate Sentinel One with ConnectWise (Or whatever you want)

MSPSentry-FOSS Integrate Sentinel One with ConnectWise Manage. Requirements Docker Node.js if you don't want to use a container (Not recommended) Some

Ted Williams 5 Sep 4, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
✏️ A small jQuery extension to turn a static HTML table into an editable one. For quickly populating a small table with JSON data, letting the user modify it with validation, and then getting JSON data back out.

jquery-editable-table A small jQuery extension to turn an HTML table editable for fast data entry and validation Demo ?? https://jsfiddle.net/torrobin

Tor 7 Jul 31, 2022
Transmute one JavaScript string into another by way of mutating its AST. Powered by babel and recast.

equivalent-exchange Transmute one JavaScript string into another by way of mutating its AST. Powered by babel and recast. Features Can parse code usin

Lily Scott 51 Jul 9, 2022
Aron 8 Dec 17, 2022
three.js examples. if you are first in learning three.js , this will give you much help.

three-projected-material Three.js Material which lets you do Texture Projection on a 3d Model. Installation After having installed three.js, install i

null 22 Nov 2, 2022