RLE Compression for node and browser
Intall via NPM
Install rle-compression using npm , npm install rle-compression
API
All available functions are :
- encode() : encoding method that walks the input string character by character.
- encode_re() : encoding method that uses a regular expression to grab the character runs, uses
forEach
Method - decode() : decoding method that uses forEach method to package array of arrays to the original string.
Usage and Example
var RLE = ;var originalMessage = "aaaaabbbbccccccccccccc";console;// using encode method of RLE compressionvar encoded = RLE;// capture the encoded data and log on consoleconsole;// use the encoded data to get original messagevar decoded = RLE;// capture the decoded data and log on consoleconsole;console;
License
Unless stated elsewhere, file headers or otherwise, the license as stated in the LICENSE file.