shuffle-promise
v1.1.0
Published
Shuffle an array with a promise
Downloads
9
Maintainers
Readme
shuffle-promise
Simple array randomization with a promise.
Install
$ npm install --save shuffle-promise
Usage
var shufflePromise = require('shuffle-promise');
var srcArray = [1, 2, 'Foo', {bar: 1}];
shufflePromise(srcArray)
.then(function(shuffledArray) {
// ['Foo', 2, {bar: 1}, 1] Yay!
})
.catch(function(error) {
// Catch errors
});
License
MIT © Dorian Camilleri