Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (24 sloc) 870 Bytes
# The SplitStr component receives a string in the in port, splits it by
# string specified in the delimiter port, and send each part as a separate
# packet to the out port
noflo = require "noflo"
class SplitStr extends noflo.Component
constructor: ->
@delimiterString = "\n"
@string = ""
@inPorts =
in: new noflo.Port()
delimiter: new noflo.Port()
@outPorts =
out: new noflo.Port()
@inPorts.delimiter.on "data", (data) =>
@delimiterString = data "data", (data) =>
@string += data "disconnect", (data) =>
@string.split(@delimiterString).forEach (line) =>
@outPorts.out.send line
@string = ""
exports.getComponent = ->
new SplitStr()
Jump to Line
Something went wrong with that request. Please try again.