1.0.1 • Published 3 years ago
string-to-chunks v1.0.1
Convert String to chunks of different sizes
Getting started
$ yarn add string-to-chunks
Usage
import stringToChunks from 'string-to-chunks';
const value = '12345';
const chunksNeeded = [1, 2, 2];
const chunked = stringToChunks(value, chunksNeeded);
console.log(chunked); // ['1', '23', '45'];