A modern version of the pull-stream collect sink which returns a promise rather than calling a callback.
collect()
const {pull, values, map} = require('pull-stream')
const collect = require('psp-collect')
pull(values([1, 2, 3]), map(x => x * 2), collect()).then(console.log)
// [ 2, 4, 6 ]
Aborting without an error will end the stream and return the value so far.
abort([err])
const {pull, values} = require('pull-stream')
const collect = require('psp-collect')
const sink = collect()
sink.abort()
pull(values([1, 2, 3]), sink).then(console.log)
// []