binaryrun
v1.3.0
Published
Create binary strings/arrays based on length of runs
Downloads
7
Maintainers
Readme
binaryrun
A small javascript library to create binary strings and arrays based on the length of runs (or blocks) of 0's and 1's.
Installation
npm install binaryrun
or
<script src="http://dimitriwalters.github.io/binaryrun/binaryrun.min.js"></script>
Usage
var binaryrun = require('binaryrun');
binaryrun.makeString([2, 1]); // '001'
binaryrun.makeString([0, 1, 2, 1]); // '1001'
binaryrun.makeArray('001'); // [2, 1]
binaryrun.makeArray('1001'); // [0, 1, 2, 1]
License
Licensed under MIT.