Simon Plenderleith gives a roundup of the new stuff that landed in Node since September 2021. Deep clone values (using structuredClone) Auto cancel async operations Fetch API Import JSON modules Abort API additions readline/promises API Corepack I’m especially excited about native fetch() support making it into Node 17. Note that you must enabled it using …
Tag Archives: node
Dock Life: Using Docker for All The Things!
Interesting take by the folks at nystudio107: instead of installing things such as node locally, why not run it in a container with an alias linked to it? Instead of installing all of the tools & packages you’re used to using, we use Docker images that someone else has created that contain these tools & …
Continue reading “Dock Life: Using Docker for All The Things!”
Cloud Function to generate SVG Sparklines
Zach Leat recently created a cloud function that dynamically generates sparklines. Under the hood sits the the sparkline-svg package to generate the SVG. The datapoints themselves can be passed in via the URL. Image URLs have the formats: /[height]x[width]/[values]/ /[height]x[width]/[values]/[color]/ The code is meant to be deployed as a Netlify Serverless Function. Every Fire needs …
Continue reading “Cloud Function to generate SVG Sparklines”
Fastify, Fast and low overhead web framework, for Node.js
It’s been a while since I’ve set up a server with Node, but turns out Fastify is preferred over Express nowadays. Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Hapi and Express and as far as we …
Continue reading “Fastify, Fast and low overhead web framework, for Node.js”
CommonJS to ESM in Node.js
With Node 12 and up supporting ES Modules natively and Node 10 — the last version to not support it unflagged — going EOL, it’s time to start migrating your code to ES Modules. Aral Balkan took the time to convert his tool “Place” to embrace them and documented his work: Yesterday, I refactored Place, …
10 best practices to containerize Node.js web applications with Docker
Solid list of tips by the folks over at Snyk: By the time you’re at number 8 your mind may have dwelled, but don’t skip out on that step though! It not only allows you to build smaller images but also prevents you from having unnecessary files (read: security risks) left inside your container. Basically …
Continue reading “10 best practices to containerize Node.js web applications with Docker”
Deno 1.0: What you need to know
deno.town
– A web REPL for experimenting with the Deno API
Running the same Node.js code on Google Cloud Functions, App Engine, and Cloud Run
Optimizing JavaScript packages for tree shaking
Geoffrey Dhuyvetters from madewithlove on how authors of (open source) JavaScript packages can optimize their builds for tree shaking: How do we create a package that exposes both CommonJS & ES modules while making sure we don’t break cross-platform support? Publishing 2 separate packages is an option (e.g. lodash/lodash-es). But there is a nicer, more …
Continue reading “Optimizing JavaScript packages for tree shaking”