# @langchain/textsplitters

> Various implementations of LangChain.js text splitters

Latest version **1.0.1** (published 2025-11-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @langchain/textsplitters
pnpm add @langchain/textsplitters
yarn add @langchain/textsplitters
bun add @langchain/textsplitters
```

## Health

**Score 75/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2025-11-24 |
| First published | 2024-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20 |
| Dependencies | 1 |
| Unpacked size | 101.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 18195 |
| Author | LangChain |
| Maintainers | hwchase17, jacoblee93, basproul, eric_langchain, andrewnguonly, nfcampos, davidduong, maddyadams, sam_noyes, hntrl, christian-bromann |

## Links

- npm: https://www.npmjs.com/package/@langchain/textsplitters
- Repository: https://github.com/langchain-ai/langchainjs
- Homepage: https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-textsplitters/
- Issues: https://github.com/langchain-ai/langchainjs/issues
- npm.io page: https://npm.io/package/@langchain/textsplitters

## Dependencies (1)

- [js-tiktoken](https://npm.io/package/js-tiktoken.md) ^1.0.12

## Recent versions

- 1.0.1 (latest) — 2025-11-24
- 1.0.0-alpha.1 (alpha) — 2025-08-28
- 0.1.0-rc.0 (next) — 2024-09-07
- 1.0.0 — 2025-10-17
- 0.1.0 — 2024-09-13
- 0.0.3 — 2024-06-06
- 0.0.2 — 2024-05-17
- 0.0.1 — 2024-05-15
- 0.0.0 — 2024-04-23

## README

# 🦜✂️ @langchain/textsplitters

This package contains various implementations of LangChain.js text splitters, most commonly used as part of retrieval-augmented generation (RAG) pipelines.

## Installation

```bash npm2yarn
npm install @langchain/textsplitters @langchain/core
```

## Development

To develop the `@langchain/textsplitters` package, you'll need to follow these instructions:

### Install dependencies

```bash
pnpm install
```

### Build the package

```bash
pnpm build
```

Or from the repo root:

```bash
pnpm build --filter @langchain/textsplitters
```

### Run tests

Test files should live within a `tests/` file in the `src/` folder. Unit tests should end in `.test.ts` and integration tests should
end in `.int.test.ts`:

```bash
$ pnpm test
$ pnpm test:int
```

### Lint & Format

Run the linter & formatter to ensure your code is up to standard:

```bash
pnpm lint && pnpm format
```

### Adding new entrypoints

If you add a new file to be exported, either import & re-export from `src/index.ts`, or add it to the `exports` field in the `package.json` file and run `pnpm build` to generate the new entrypoint.

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