$ npm install list-to-matrix
Convert list to matrix
listToMatrix([1, 2, 3, 4, 5, 6, 7, 8, 9], 3) // => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]