const array = [], result = [];
var str = "text\ntext2\ntext3\ntext4\ntext5\ntext6\ntext7\ntext8".split("\n");
var count = Math.round(str.length/6);
while(str.length) result.push(str.splice(0,count)); // Разбираем массив
console.log(result);
const numChunks = 6;
const chunkLen = arr.length / numChunks | 0;
const chunks = Array.from({ length: numChunks }, (n, i) => {
return arr.slice(i * chunkLen, i === numChunks - 1 ? arr.length : (i + 1) * chunkLen);
});