Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

run-length-encoder-decoder

bmshamsnahid9ISC1.0.4

Run length algorithm implement for encoding and decoding

readme

Run Length Encoder Decoder

A small library that endcode and decode words using Run Length Algorithm

Installation

npm i run-length-encoder-decoder --save

Usage

let runLengthEncoderDecoder = require('run-length-encoder-decoder');

runLengthEncoderDecoder.encoder('aabbcccaaaaa', (err, result) => {
    if (err) {
        console.log(err);
    } else {
        console.log('Encode: ' + result);
        runLengthEncoderDecoder.decoder(result, (err, result) => {
            if (err) {
                console.log(err);
            } else {
                console.log('Decode: ' + result);
            }
        });
    }
});

Encoder Output should be a2b2c3a5
Decoder Output should be aabbcccaaaaa