Categories
ECMAScript modules Node.js

What you need to know about ES modules in Node.js

7 min read TL;DR Jump links Several names for the same thing Which versions of Node.js have full support for ES modules? Why are ECMAScript modules marked as ‘Experimental’ in the Node.js documentation? ES and CommonJS modules play nice together (mostly) Use ES modules when you start a new Node.js project It’s probably not worth migrating your existing […]

Categories
Learning Fastify Node.js Videos

Trying out HTTP Toolkit with fastify-http-proxy

< 1 min read Links

Categories
Express Node.js

Send awesome structured error responses with Express

9 min read Jump links Introducing the ‘Problem Details for HTTP APIs’ specification Problem types and Problem details objects Example problem details response More details, clearer problems Breakdown of a problem details object How to send problem details responses with Express Define problem types and map them to JavaScript error classes Look up the problem details for an […]

Categories
Express Node.js

How to create an error handler for your Express API

7 min read Jump links Getting errors to error handler middleware Creating an error handler Error handler concerns Error handler middleware function Error handler helper functions Applying the error handler middleware Example error response Next steps Getting errors to error handler middleware Creating an error handler Error handler concerns Error handler middleware function Error handler helper functions Applying […]

Categories
Express Node.js

How to handle request validation in your Express API

9 min read Jump links Getting to grips with JSON Schema Why should I use JSON Schema and not validation library X? How to integrate validation with JSON schemas into your application Pulling it all together Wrapping things up Handy JSON Schema links