git ssb

2+

cel / scuttlebot.io



Tree: 18ca2b47b86cd361c03c92c0682500c5fa00451f

Files: 18ca2b47b86cd361c03c92c0682500c5fa00451f / tmpl / apis / pull-stream / core-sources.md

1011 bytesRaw

Sources

A source is a stream that is not writable. You must have a source at the start of a pipeline for data to move through.

in general:

pull(source, through, sink)

See also:

values (array | object)

create a SourceStream that reads the values from an array or object and then stops.

keys (array | object)

stream the key names from an object (or array)

count (max)

create a stream that outputs 0 ... max. by default, max = Infinity, see take

infinite (generator)

create an unending stream by repeatedly calling a generator function (by default, Math.random) see take

empty

A stream with no contents (it just ends immediately)

pull.empty().pipe(pull.collect(function (err, ary) {
  console.log(arg)
  // ==> []
})

Built with git-ssb-web