create-batches
v1.0.3
Published
A package to create batches based on max batch limit.
Downloads
7
Maintainers
Readme
Create Batches based on max batch size limit!
const createBatches = require('create-batches');
let batches1 = createBatches([[2,3,4,5,1,4,8,7]], 3);
console.log(batches1);
let batches2 = createBatches([[2,3,4,5,1,4,8,7], [143,54,124,543,1342]], 3);
console.log(batches2);
OUTPUT -
[ [ 2, 3, 4 ], [ 5, 1, 4 ], [ 8, 7 ] ]
[ [ 2, 3, 4 ], [ 5, 1, 4 ], [ 8, 7 ], [ 143, 54, 124 ], [ 543, 1342 ] ]