# text-to-chunks

> A utility to split text into multiple chunks.

Latest version **1.0.1** (published 2023-05-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install text-to-chunks
pnpm add text-to-chunks
yarn add text-to-chunks
bun add text-to-chunks
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-05-02 |
| First published | 2023-05-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Jasper Alexander |
| Maintainers | jasperalexander |
| Keywords | text, convert, converter, chunk, chunks, split, splitter, ai |

## Links

- npm: https://www.npmjs.com/package/text-to-chunks
- Repository: https://github.com/JasperAlexander/ai-utils
- Homepage: https://github.com/JasperAlexander/ai-utils/tree/main/packages/text-to-chunks/README.md
- Issues: https://github.com/JasperAlexander/ai-utils/issues
- npm.io page: https://npm.io/package/text-to-chunks

## Dependencies (4)

- [jest](https://npm.io/package/jest.md) ^29.5.0
- [ts-jest](https://npm.io/package/ts-jest.md) ^29.1.0
- [@types/jest](https://npm.io/package/@types/jest.md) ^29.5.1
- [@types/node](https://npm.io/package/@types/node.md) ^17.0.45

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-05-02
- 1.0.0 — 2023-05-01

## README

# text-to-chunks

A utility to split text into multiple chunks.

## Installation

Go to the root of your project directory and run the following command.

```sh
pnpm add text-to-chunks
```

## Usage

```tsx
'use client'

import { textToChunks } from 'text-to-chunks'

export default function Page() {
  const [text, setText] = useState('')
  const [chunks, setChunks] = useState<string[]>([])

  function generateChunks() {
    const newChunks = textToChunks({text: text})
    setChunks(newChunks)
  }

  return (
    <div>
      <input type='text' value={text} onChange={(e) => setText(e.target.value)} />
      <button type='button' onClick={() => generateChunks()}>Generate</button>
      {chunks}
    </div>
  )
}

```

## Contributing

If you're interested in contributing, please read the [contributing docs](../../CONTRIBUTING.md) before submitting a pull request.

## License

This package is licensed under the MIT License. See [LICENSE](../../LICENSE.md) for more information.

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