1.0.1 • Published 3 years ago

string-to-chunks v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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