/string-to-chunks

Generate chunks of strings

Primary LanguageTypeScript

Convert String to chunks of different sizes

Build and test

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'];