https://github.com/shahen94/string-to-chunks
Generate chunks of strings
https://github.com/shahen94/string-to-chunks
Last synced: 3 months ago
JSON representation
Generate chunks of strings
- Host: GitHub
- URL: https://github.com/shahen94/string-to-chunks
- Owner: shahen94
- Created: 2021-05-04T13:33:07.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-04T14:26:24.000Z (about 4 years ago)
- Last Synced: 2025-02-03T18:08:20.519Z (4 months ago)
- Language: TypeScript
- Size: 71.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Convert String to chunks of different sizes
[](https://github.com/shahen94/string-to-chunks/actions/workflows/build.yml)
### Getting started
```sh
$ yarn add string-to-chunks
```### Usage
```typescript
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'];
```