binaryrun

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i binaryrun

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dimitriwalters