The new stable timers API in Node 16, combined with top-level await, means that you can now easily sleep in an ESM Node script, like this:<p><pre><code> import { setTimeout } from 'timers/promises';
await setTimeout(1000);
console.log("awake");
</code></pre>
(But note that you'll have to activate ESM mode to write this script, e.g. by writing it in a `.mjs` file instead of a `.js` file or by adding a setting to package.json.) <a href="https://redfin.engineering/node-modules-at-war-why-commonjs-and-es-modules-cant-get-along-9617135eeca1" rel="nofollow">https://redfin.engineering/node-modules-at-war-why-commonjs-...</a>
Are there anyone in HN community using Node.js for mission critical backends? Even though I am perfectly happy to do that and does, especially with Typescript support, I have seen increasing number of backend devs who are more comfortable to use a static typed stack like Java or Go. Wonder if Node.js will ever get wider adoption like Java got.
I love Node - does anyone have good experiences with using Node with Rust/Java/C++ for interop as necessary performance wise?<p>I know it's possible and that some teams do it, but the story wasn't great with (much) earlier versions of node. Some teams just wrote their stuff in another language and just use a child process in node to call it, serializing everything as a string and DE serializing it in the other language. The problem with that though is that you suffer a pretty decent performance penalty serializing and deserializing, and though it still might be worth it, it's also not great since some teams actually just called similarly to how you'd call a shell script.<p>Is it much better than that now?
What excites me most about Node upgrades are the introduction of new native Javascript capabilities, because of the underlying V8 upgrade. You can figure out what those capabilities are on this website: <a href="https://node.green/" rel="nofollow">https://node.green/</a>.<p>You have to scroll down all the way to "Node.js ES2021 Support" to start seeing features that work in Node 16 but not Node 14 (the current LTS version). Of course, it's possible to use Babel to bring those features into Node 14, but I enjoy leaving it out of my toolchain when possible.
<i>Node.js v16.0.0 will be the first release where we ship prebuilt binaries for Apple Silicon. While we’ll be providing separate tarballs for the Intel (darwin-x64) and ARM (darwin-arm64) architectures the macOS installer (.pkg) will be shipped as a ‘fat’ (multi-architecture) binary.</i><p>Apple presenting some major hardware news today. Perfect time to release v16 :)
Ooh, and there's an official darwin-arm64 binary too :) <a href="https://nodejs.org/dist/v16.0.0/" rel="nofollow">https://nodejs.org/dist/v16.0.0/</a>
> This update brings the ECMAScript RegExp Match Indices, which provide the start and end indices of the captured string. The<p>I'm curious, because I'm useless at RegEx.. But will this break current RexEx implementations ??
I have always been wondering how Node.js will do as a backend option. I feel it's in decline, a quick google trend confirms it: <a href="https://trends.google.com/trends/explore?date=today%205-y&q=%2Fm%2F0bbxf89" rel="nofollow">https://trends.google.com/trends/explore?date=today%205-y&q=...</a><p>I invested quite some time on node.js and eventually bailed out and now am using other alternatives. It did not work out as not all applications need those async-logics which made code unnecessarily difficult.<p>Nowadays for me, nodejs along with npm/yarn are just more of a frontend tool, which are still very useful and essential.