0.2.2 • Published 6 years ago

faro v0.2.2

Weekly downloads
6
License
MIT
Repository
-
Last release
6 years ago

README

Faro

Perform faro out-shuffle for a string or an array. More information about faro: https://en.wikipedia.org/wiki/Faro_shuffle

Installation

npm i -S faro

Usage:

const faro = require('faro');

const { shuffle, unshuffle } = faro;

console.log(shuffle('foobar'));     // Shows fboaor
console.log(unshuffle('fboaor'));   // Shows foobar

Unshuffle undoes what shuffle does. The other way around would work too.

You can do the same, but for arrays:

const faro = require('faro');

const { shuffleArray, unshuffleArray } = faro;

console.log(shuffleArray(['f','o','o','b','a','r']));
console.log(unshuffleArray(['f','b','o','a','o','r']));

The following functions are available:

shuffle
shuffleArray
unshuffle
unshuffleArray
weave
weaveArray
unweave
unweaveArray

weave and shuffle are aliases, as are unweave and unshuffle.

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago