2013.12.12 MNUG - How streams help to raise Node.js performance

Christoph Stock · 14K views · 2013 · 1:01:25

Open on YouTube

Web developmentSoftware performance & optimizationtalk

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about Node.js streams, since the speaker gives a full walkthrough that is too long to explain in a short answer.

Recommended by 2 people across 2 different months, 2012 to 2018.

What it is

A one-hour talk by Golo Roden at the Munich Node.js User Group (MNUG) on how Node.js streams work and how they help improve performance. It includes a worked example using a stream to calculate prime numbers, with source code on GitHub.

What people said

Recommends Golo Roden · 2017-06 · Stack Overflow · on “Techniques for having a node module return a "stream" of data?”

You may use Node.js's stream module for this. It's hard to answer your question within a few lines of code, but if you are really interested in how streams work, have a look at this video [this video] (this is me giving a talk about Node.js streams at the Node.js meetup in Munich, Germany). Alternatively, you may use a generator function with yield , but this as well is hard to explain from scratch in a few lines. Anyway, streams and generator functions are the terms you should look for.

Recommends Golo Roden · 2017-06 · Stack Overflow · on “Techniques for having a node module return a "stream" of data?”

BTW: Accidentally, within this talk, I had an example of how to use a stream to calculate prime numbers… ;-))) … starting at 36:09 - [this video]

Recommends Dylan Landry · 2018-10 · Stack Overflow · on “Gulp: Accessing Added Vinyl Properties”

I have done it. Given the original stream which ended with gulp-front-matter pushing modified vinyl file objects, I was able to access the new yaml properties by tacking on my own transform stream that read the incoming vinyl object. The example I've included is absent of any Gulp 4 task implementation, it works by just running node index.js . const { Transform } = require('stream'); const { src, dest } = require('gulp'); const Vinyl = require('vinyl'); const frontMatter = require('gulp-front-matter'); const streamToArray = require('stream-to-array'); function fmData() { return ( new Transform({ readableObjectMode: true, writableObjectMode: true, transform(chunk, encoding, callback) { if (Vi

Cites Nevir · 2012-03 · Stack Overflow · on “How do I get started with Node.js”

First, learn the core concepts of Node.js: You'll want to understand the asynchronous coding style that Node.js encourages [LINK] . Async != concurrent. Understand Node.js's event loop [LINK] ! Node.js uses CommonJS-style require() for code loading; it's probably a bit different from what you're used to [LINK] . Familiarize yourself with Node.js's standard library [LINK] . Then, you're going to want to see what the community has to offer: The gold standard for Node.js package management is NPM [LINK] . It is a command line tool for managing your project's dependencies [LINK] . Make sure you understand how Node.js and NPM interact with your project via the node_modules folder and package.json