# text-chopper

> Chop a large text to array

Latest version **1.0.7** (published 2025-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install text-chopper
pnpm add text-chopper
yarn add text-chopper
bun add text-chopper
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2025-09-13 |
| First published | 2019-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Koji Takami |
| Maintainers | vzg03566 |
| Keywords | text, chop, divide |

## Links

- npm: https://www.npmjs.com/package/text-chopper
- Repository: https://github.com/takamin/text-chopper
- Homepage: https://github.com/takamin/text-chopper#readme
- Issues: https://github.com/takamin/text-chopper/issues
- npm.io page: https://npm.io/package/text-chopper

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^4.4.3
- [buffer](https://npm.io/package/buffer.md) ^5.4.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2025-09-13
- 1.0.6 — 2021-04-19
- 1.0.5 — 2020-12-06
- 1.0.4 — 2020-03-14
- 1.0.3 — 2019-12-07
- 1.0.2 — 2019-11-26
- 1.0.1 — 2019-11-23
- 1.0.0 — 2019-11-23

## README

text-chopper
============

Divide a long text to small chunks.
The text is divided at just the end of line.
The byte length of each chunks are smaller than a size specified by
`chunkSize` of parameter `options`.

This is available on both of browser and node.js

## USAGE

Import this module by the CommonJS way.

```javascript
const TextChopper = require("text-chopper");

const text = [
    "ABCDEFG",
    "HIJKLMN",
    "OPQRSTU",
].join("\r\n");

const chunks = TextChopper.chop(
    text, {chunkSize: 10});

// chunks[0] == "ABCDEFG\r\n"
// chunks[1] == "HIJKLMN\r\n"
// chunks[2] == "OPQRSTU\r\n"
```

## INSTALLATION

Use npm to install.

```bash
$ npm install --save text-chopper
```

---
_Source: https://npm.io/package/text-chopper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
