2018-12

ECMAScript modules in Node.js: the new plan

[2018-12-20] dev, javascript, nodejs, jsmodules

Status of ECMAScript module (ESM) support in Node.js:

  • Experimental support for ESM was added in Node.js 8.5.0 (2017-09-12).
  • Afterwards, the Node.js Foundation Technical Steering Committee formed the Modules Team to help design missing pieces and to guide the implementation towards its (non-experimental) release. The Modules Team is comprised of people from several different web development areas (frontend, backend, JS engines, etc.).

In October, the Modules Team published the document “Plan for New Modules Implementation”. This blog post explains what it contains.

2018-08

Behind the scenes of my latest book on JavaScript

[2018-08-22] book, javascript

This blog post takes you behind the scenes of my latest book, “JavaScript for impatient programmers” (which I’ll occasionally abbreviate as “Impatient JS”). It describes:

  • How I chose what to write about.
  • My techniques for explaining topics.
  • Tools I used for creating ebooks and other artifacts.
  • How I unit-tested the code shown in the book and in its quizzes.

Running code snippets via Node.js and nodemon

[2018-08-15] dev, javascript, nodejs, nodemon

This blog post describes a trick for running a snippet of JavaScript code with Node.js while working on it.

Setting up constants via proxies

[2018-08-11] dev, javascript, js proxies

In this blog post, a describe a little hack for quickly setting up constants (think enum values, but not wrapped inside a namespace). It is more an educational puzzle than something you should actually use in your code.

2018-05

Working with stdout and stdin of a child process in Node.js

[2018-05-05] dev, javascript, nodejs, async

In this blog post, we run shell commands as child processes in Node.js. We then use async language features to read the stdouts of those processes and write to their stdins.

2018-04

Coding recipe: extracting loop functionality (via callbacks and generators)

[2018-04-29] dev, javascript, coding

In this blog post, we look at two ways of extracting the functionality of a loop: internal iteration and external iteration.

Tip: npm-installing directories

[2018-04-24] dev, javascript, nodejs, npm

Quick tip: npm lets you install directories, which is occasionally useful for organizing projects. For example, as a temporary step before uploading packages to npm (think lightweight npm link).

Understanding TypeScript’s type notation

[2018-04-08] dev, javascript, typescript

This blog post is a quick introduction to TypeScript’s notation for static types.

Reading streams via async iteration in Node.js

[2018-04-01] dev, javascript, nodejs, async

Node.js 10 was released on April 24, 2018. This version provides experimental support for asynchronously iterating over readable streams. This blog post explains how that works.

2018-03

JavaScript vs. TypeScript vs. ReasonML

[2018-03-18] dev, javascript, typescript, reasonml

In this blog post, I describe the pros and cons of three programming languages/dialects: JavaScript, TypeScript and ReasonML. My descriptions are based on recent experiences with TypeScript and ReasonML on a few smaller real-world projects and on years of experience with JavaScript.