# split-text

> Split a text into an array of chunks. Their length is determined by the `limit` argument. It will no cut off words unless there is no spaces in the text. Returns an array with the chunks.

Latest version **1.0.0** (published 2015-05-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-05-23 |
| First published | 2015-05-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Kahlil Lechelt |
| Maintainers | distilledhype |
| Keywords | text, splitting |

## Links

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

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-05-23

## README

# split-text

> Split a text into an array of chunks. Their length is determined by the `limit` argument. It will no cut off words unless there is no spaces in the text. Returns an array with the chunks.


## Install

```
$ npm install --save split-text
```


## Usage

```js
var splitText = require('split-text');

splitText('unicorns are awesome', 15);
//=> ['unicorns are', 'awesome']
```


## API

### splitText(text, limit)

#### text

*Required*  
Type: `string`

A string of text.

#### limit

*Required*
Type: `number`  

The max size of the chunks.

## License

MIT © [Kahlil Lechelt](http://kahlil.info)

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