Skip to content

Instantly share code, notes, and snippets.

View woanversace's full-sized avatar
💭
I may be slow to respond.

Khiet Vo woanversace

💭
I may be slow to respond.
View GitHub Profile
@woanversace
woanversace / 01-fractal-weird-design.md
Created June 28, 2016 03:57 — forked from spion/01-fractal-weird-design.md
Node streams - a fractal of weird design

Node streams - a fractal of weird design

and a potential refactor that could fix that

This is a list of issues and confusions I've encountered with node streams, and things I wish were designed and implemented differently. If promise-streams is ever going to change to a design that doesn't build on top of node streams, this would be a list of mistakes to avoid

  1. enc parameter - Why is encoding always passed together with the data? It should be a separate concern. It doesn't even make sense in objectMode
  2. eventemitter base - There is no reason to use an uncomposable grab-bag of stringy events as a base
  3. relying on nextTick etc for execution order - This is very unreliable and causes all sorts of unpredictable rules for implementers which are not documented anywhere.
  4. no error propagation
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@woanversace
woanversace / 0_reuse_code.js
Created June 20, 2014 10:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console