Node.js Weekly Update - 9 Dec, 2016

If you miss something from this Node.js weekly update, please let us know in the comments!

6 Must-read Articles, Updates of the Week:

○ Advanced Node.js Project Structure

This tutorial guides you through structuring a complex Node.js project with examples.

Project structuring is an important topic because the way you bootstrap your application can determine the whole development experience throughout the life of the project.

○ Dear JavaScript,

A heartful and elaborate letter to the JavaScript community discussing the ubiquitous negativity surrounding the scene.

Being a maintainer of a Javascript project with tens of thousands of users means you face a lot of criticism. It almost feels like you’re a politician at times. Some of it isn’t valid, but much of it is. Either way, the sad thing is that criticism is often communicated in an extremely negative fashion.

○ Internet of Stranger Things

A cool DIY home project that replicates the famous ABC lights from Stranger Things.

This year I’ve been running a workshop about using JavaScript and Node.js to work with all different kinds of electronics on the Raspberry Pi. So I’m going to show you how I made a very special Raspberry Pi based internet connected project! And nothing says Christmas quite like a set of fairy lights connected to another dimension.

Node.js and Raspberry Pi used to replicate the lights from Stranger Things

○ Lockfiles should be committed on all projects - Yarn

If you are installing a new dependency or upgrading an existing one you should check to make sure the package works as intended and is not breaking your code.

Yarn is a new package manager that we built to be consistent and reliable. When installing hundreds or even thousands of third-party packages from the internet you want to be sure that you’re executing the same code across every system.

○ Auto-detect node version in npm start

Wouldn't it be cool if, when you run npm start it detects the version of node required, and it switches to using that?

I posed myself the question: why isn't engines.node used to load the right version of node when I run npm start? It's great that this value is used when I'm deploying to a service like Heroku, but I also want to use it locally.

○ Implementing the IRC spec in Node.js

The IRC spec really is a simple protocol, and you don’t need to be a genius to figure it out. To prove it, the author goes over some excerpts of RFC 1459 to gain an understanding of how the protocol works.

IRC has always been a big part of my life. Some of my strongest friendships grew from chatting in IRC channels I visited every day since I was a teen. As I walked along the path to a career in computer science, it was only natural that I’d wonder how it all worked under the hood. But where do you even start?

Important Updates to the Node.js Core

Node v7.2.1 (Current) released

  • buffer:
    • Reverted the runtime deprecation of calling Buffer() without new. (Anna Henningsen) #9529
    • Fixed buffer.transcode() for single-byte character encodings to UCS2. (Anna Henningsen) #9838
  • promise: --trace-warnings now produces useful stacktraces for Promise warnings. (Anna Henningsen) #9525
  • repl: Fixed a bug preventing correct parsing of generator functions. (Teddy Katz) #9852
  • V8: Fixed a significant instanceof performance regression. (Franziska Hinkelmann) #9730

Node v4.7.0 (LTS) released

  • build: export openssl symbols on Windows making it possible to build addons linking against the bundled version of openssl (Alex Hultman) #7576
  • debugger: make listen address configurable in the debugger server (Ben Noordhuis) #3316
  • dgram: generalized send queue to handle close fixing a potential throw when dgram socket is closed in the listening event handler. (Matteo Collina) #7066
  • http: Introduce the 451 status code "Unavailable For Legal Reasons" (Max Barinov) #4377
  • tls: introduce secureContext for tls.connect which is useful for caching client certificates, key, and CA certificates. (Fedor Indutny) #4246

Node v6.9.2 (LTS) released

  • buffer: coerce slice parameters consistently (Sakthipriyan Vairamani (thefourtheye)) #9101
  • gtest: the test reporter now outputs tap comments as yamlish (Johan Bergström) #9262
  • inspector: inspector now prompts user to use rather than localhost (Eugene Ostroukhov) #9451
  • tls: fix memory leak when writing data to TLSWrap instance during handshake (Fedor Indutny) #9586

Previously in the Node.js Weekly Update

Last week we read fantastic articles about the new Node.js API, the donation of the Node Security Project and about the funding of hapi.js. We also found a great tutorial on native node.js modules.