JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 80
  • Score
    100M100P100Q76602F
  • License MIT

split ported to pull-stream style

Package Exports

  • pull-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 (pull-split) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pull-split

split ported to pull-stream style.

Example

var pull = require('pull-stream')
var split = require('pull-split')

pull(
  textStream
  split(),
  output
)

if the textStream is buffers, and contain UTF8 (it probably will if you have german or chinese friends, etc) then you MUST use this with pull-utf8-decoder

var pull = require('pull-stream')
var split = require('pull-split')
var utf8 = require('pull-utf8-decoder')

pull(
  textStream
  utf8(),
  split(),
  output
)

split(matcher, mapper, reverse, skipLast)

matcher - string or regexp.

unit to split by, defaults to \n

mapper - function

function to apply to each line matched.

reverse - boolean

if true, emit lines in reverse. use this if the input is a file you are reading backwards.

skipLast - boolean

use this to skip the last value if it is and empty string '' if this is not set then the behavior is the same as String#split

License

MIT