# split-buffer

> split a buffer into sections with a max length.

Latest version **1.0.0** (published 2015-06-02) · MIT license · 0 weekly downloads

## Install

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

## 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-06-02 |
| First published | 2015-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/split-buffer
- Repository: https://github.com/dominictarr/split-buffer
- Issues: https://github.com/dominictarr/split-buffer/issues
- npm.io page: https://npm.io/package/split-buffer

## Recent versions

- 1.0.0 (latest) — 2015-06-02

## README

# split-buffer

split a buffer into sections with a max length.

# example

``` js
var split = require('split-buffer')

var buffers = split(buffer, M)
```

`split` returns an array of buffers,
if `buffer.length <= M` it returns `[buffer]`. 

If `buffer.length > M` it returns `ceil(buffer.length/M)`,
all but the last buffer will have length `M` and the last buffer
will have length `buffer.length%M`.

`split-buffer` uses `Buffer#slice` so all buffers still refer
to the same memory as the original buffer.

## License

MIT

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