Adventures in Nodeland logo

Adventures in Nodeland

Subscribe
Archives
September 13, 2021

Pino@7.0.0-rc.4 and other Adventures in Nodeland - Issue #26

Hi Folks,

I’m back from Austria after some time with my family! Last week has been incredibly busy Node-wise. and I can’t wait to share it all with you.

Pino

We have worked pretty hard in finishing off pino@7 and we have now reached the 4th release candidate. There is likely some more work to do, but this release looks incredibly solid. The goal is to encourage most people to use the new transport system for most of their work.

Release v7.0.0-rc.4 · pinojs/pino · GitHub
Release v7.0.0-rc.4 · pinojs/pino · GitHub
🌲 super fast, all natural json logger 🌲. Contribute to pinojs/pino development by creating an account on GitHub.
github.com
Release v7.0.0-rc.4 · pinojs/pino · GitHub
Release v7.0.0-rc.4 · pinojs/pino · GitHub
🌲 super fast, all natural json logger 🌲. Contribute to pinojs/pino development by creating an account on GitHub.
github.com

The most significant change is the deprecation of the `prettyPrint` option in pino. This option is extremely common as an easy-to-use solution to log things in a format that is easy to consume by humans. What we replaced this option with? The new transport system of course!

In order to achieve this, we augmented pino-pretty with pino-abstract-transport that allowed it to become transport-compatible with a “small” but semver-major change.

Use pino-abstract-transport by mcollina · Pull Request #222 · pinojs/pino-pretty · GitHub
Use pino-abstract-transport by mcollina · Pull Request #222 · pinojs/pino-pretty · GitHub
This change makes this module compatible with the new transport system. This is the first step for pinojs/pino#1106. It is a semver-major change and it will require a minor change in pino@6 and pino@7 to achieve compatibility. before we exported the prettyFactory, now we export the function to build a transport, which includes split2.
github.com
Use pino-abstract-transport by mcollina · Pull Request #222 · pinojs/pino-pretty · GitHub
Use pino-abstract-transport by mcollina · Pull Request #222 · pinojs/pino-pretty · GitHub
This change makes this module compatible with the new transport system. This is the first step for pinojs/pino#1106. It is a semver-major change and it will require a minor change in pino@6 and pino@7 to achieve compatibility. before we exported the prettyFactory, now we export the function to build a transport, which includes split2.
github.com

Then we had to adapt pino itself and adjust the API. This change did change some API from rc.3 but it is for the best. See for yourself:

pino-pretty transport convertion by mcollina · Pull Request #1110 · pinojs/pino · GitHub
pino-pretty transport convertion by mcollina · Pull Request #1110 · pinojs/pino · GitHub
See #1106. Implement the matching changes in pinojs/pino-pretty#222.
github.com
pino-pretty transport convertion by mcollina · Pull Request #1110 · pinojs/pino · GitHub
pino-pretty transport convertion by mcollina · Pull Request #1110 · pinojs/pino · GitHub
See #1106. Implement the matching changes in pinojs/pino-pretty#222.
github.com

I’m extremely satisfied with this pino release, and I think we will be able to fully release v7 into the wild sooner rather than later. Check it out!

Fastify

Release v3.21.0 · fastify/fastify · GitHub
Release v3.21.0 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com
Release v3.21.0 · fastify/fastify · GitHub
Release v3.21.0 · fastify/fastify · GitHub
Fast and low overhead web framework, for Node.js. Contribute to fastify/fastify development by creating an account on GitHub.
github.com

Node.js

August 31 2021 Security Releases | Node.js
August 31 2021 Security Releases | Node.js
Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine.
nodejs.org

I often write about new security releases of Node.js (as I’m part of the security team), and this edition is no exception. From the last time you received one of my digital envelopes, we had a significant new vulnerability in NPM that could enable a supply-chain attack. This was fixed upstream and we released v12 and v14 to keep all of you safe.

One of biggest feature that was released in Node.js in 2021 is corepack. Corepack is a tool that enables to install any of the alternative package managers (yarn, pnpm) alongside npm. Read up in the docs:

Corepack | Node.js v16.9.0 Documentation
Corepack is an experimental tool to help with managing versions of your package managers. It exposes binary proxies for each supported package manager that, when called, will identify whatever package manager is configured for the current project, transparently install it if needed, and finally run it without requiring explicit user interactions.
nodejs.org

Would you like to write some isomorphic code that uses undici underneath? You can know use fetch-undici to use window.fetch in the browser, and undici.fetch in Node.js.

GitHub - bcomnes/fetch-undici: Isomorphic fetch with window.fetch and undici.fetch
GitHub - bcomnes/fetch-undici: Isomorphic fetch with window.fetch and undici.fetch
Isomorphic fetch with window.fetch and undici.fetch - GitHub - bcomnes/fetch-undici: Isomorphic fetch with window.fetch and undici.fetch
github.com

New Releases!

Last week I release fastq@1.13.0 which included a new feature for the promise API of the queue: run to completion or queue.drained()! Check it out:

feat: run to completion by gillesdemey · Pull Request #57 · mcollina/fastq · GitHub
feat: run to completion by gillesdemey · Pull Request #57 · mcollina/fastq · GitHub
This essentially adds a simple helper function to wait for the queueAsPromised to be drained, quite useful if fastq is used as a Promise.all() function but with concurrency. Fixes #47
github.com
feat: run to completion by gillesdemey · Pull Request #57 · mcollina/fastq · GitHub
feat: run to completion by gillesdemey · Pull Request #57 · mcollina/fastq · GitHub
This essentially adds a simple helper function to wait for the queueAsPromised to be drained, quite useful if fastq is used as a Promise.all() function but with concurrency. Fixes #47
github.com

Interesting Articles

I met Swyx a few years back at JSConf Hawaii and then in Manhattan. He is always full of insights on how to build you career in Tech and online. This article fascinates me, check it out:

The Swipe Files Strategy for Part Time Creators ∊ swyx.io
The Swipe Files Strategy for Part Time Creators ∊ swyx.io
Swipe Files are underrated, passively compounding sources of personal leverage for your creator journey. #creators Read time: 4 minutes | What if I told you there was a simple strategy that can help you slow-cook a $300,000 a year side project and kickstart your indie hacker career, on a few hours a week?
www.swyx.io
Don't miss what's next. Subscribe to Adventures in Nodeland:
GitHub X YouTube LinkedIn