node-srls

1.1.0 • Public • Published

node-srls

node string-run-length string

Do you want to get the run length of a string? Use this package.

npm | github

Usage

    npm install --save node-srls
    var runLengthLib = require('node-srls');
    var input = 'aaabbbb ccccccc     ';
    var runLength = runLengthLib.runLengthStringOf(input);
    console.log(runLength);
    // "a3b3 1c6 5"
    runLength = runLengthLib.runLengthArrayOf(input);
    console.log(JSON.stringify(runLength));
    // [ 'a', 3, 'b', 4, ' ', 1, 'c', 7, ' ', 5 ]

That's all folks;

Package Sidebar

Install

npm i node-srls

Weekly Downloads

0

Version

1.1.0

License

ISC

Last publish

Collaborators

  • faxian