from Hacker News

Show HN: A Node.js stream library that works with promises

by reconbot on 11/6/18, 8:36 PM with 3 comments

  • by reconbot on 11/6/18, 8:47 PM

    Hi I built this little stream processing library so I could write things like;

      const stats = await pipe(
        Nodes.scan({ fields: true }),
        map(generateStats),
        tap(() => count++),
        reduce(mergeGraphStats, {})
      )
    
    
    and have generateStats and mergeGraphStats be async functions and not have to worry about error handling and pushing more than one object at a time in a read stream. We use it to process billions of events and objects a day. It makes nodejs streams fun to use.

    Hope you find it as useful as we do.