Skip to content

Simple text compression by character substitution of the most common words.

Notifications You must be signed in to change notification settings

joshuacurtiss/simple-text-compress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Text Compression

This library handles simple text compression by substituting the most common words with unused characters.

Installation and Usage

Add the library to your project:

npm install simple-text-compress

Then simply execute the compress and decompress functions. You could pull them out of the library like this:

const { compress, decompress } = require('simple-text-compress');

Compression

const myBigText = 'Lorem ipsum ... blah blah blah ipsum flipsum.';
const compressed = compress(myBigText);

The compressed variable will be an object:

  • data: The text in its compressed form.
  • dict: An object dictionary for all the character/word substitutions.

Decompression

const decompressed = decompress(compressed.data, compressed.dict);

The decompressed variable will be the text restored to its original form.

About

Simple text compression by character substitution of the most common words.

Resources

Stars

Watchers

Forks

Packages

No packages published