JSPM

buffer-split

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1962
  • Score
    100M100P100Q118288F

split a buffer by another buffer. think String.split()

Package Exports

  • buffer-split

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (buffer-split) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

buffer-split

split a buffer by another buffer. think String.split()

var bsplit = require('buffer-split')
, b = new Buffer("this is a buffer i like to split")
, delim = new Buffer('buffer')
, result = bsplit(b,delim)
;

result.length === 2

result[0].toString() === "this is a "

result[1].toString() === " i like to split"

you may include the delimiter in the result by passing a thrthy value as the third arg. its more efficient if you need it.

var bsplit = require('buffer-split')
, b = new Buffer("this is a buffer i like to split")
, delim = new Buffer('buffer')
, result = bsplit(b,delim,true)
;

result[0].toString() === "this is a buffer"

result[1].toString() === " i like to split"