split-buffer

1.0.0 • Public • Published

split-buffer

split a buffer into sections with a max length.

example

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    163
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    163

Package Sidebar

Install

npm i split-buffer

Weekly Downloads

163

Version

1.0.0

License

MIT

Last publish

Collaborators

  • nopersonsmodules