
The Node.js Project Introduces Latest Release Line: Node.js 10.x - alvis
https://medium.com/@nodejs/the-node-js-project-introduces-latest-release-line-node-js-10-x-bf07abfa9076
======
talawahdotnet
Good to see that they are adding promisified versions of more core function
like fs. It makes things even simpler for new users especially with
async/await support.

I _really_ wish they would add a promise based version of the http/https
client. The current version uses events rather than the standard callback
signature so it can't be automatically converted using util.promisify().

They don't have to modify the existing low-level http client, just add a new
API. They could even use the existing fetch() API that users are already
familiar with on the client side.

It really should be dead simple for a new user to make an http call in Node
without having to npm install a 3rd party library. I recently created an AWS
Lambda function (directly via the console) and I just wanted to check to see
what the outside world thought my IP was. In theory, with Node.js 8 It should
only take a two liner like this:

    
    
      const response = await fetch('https://httpbin.org/ip');
      return response.json();
    

Instead I had to wrap it in a promise myself using untested code that I
cribbed from StackOverflow[1].

1.[https://gist.github.com/talawahtech/f8c4452dbb543297a008d385...](https://gist.github.com/talawahtech/f8c4452dbb543297a008d3856ef47adb)

~~~
untog
There's a module named `node-fetch` that mirrors the client Fetch API. Might
make for a better solution. (but I agree it would be great for it to be built
in)

~~~
alacombe
I would not recommend `node-fetch', it's pretty crappy in term of performance
if you are hitting a same host and expect some kind of keep-alive /
pipelining. Switching to `make-fetch-happen' fixed all my issues.

~~~
Can_Not
Also if you're not intentionally looking to use a low level API, axios is much
better.

------
koolba
Having async_hooks in an LTS release is going to be awesome. The v10.x docs
aren't live yet but I'm assuming it'd be similar to the v9.x functionality[1].
There's a lot of interesting use cases for it and I think it's the long term
replacement for one of the major use cases for domains[2], namely continuation
local storage. Domains have been available but deprecated since v0.10 so great
to see a path forward to finally switch off them.

[1]:
[https://nodejs.org/dist/latest-v9.x/docs/api/async_hooks.htm...](https://nodejs.org/dist/latest-v9.x/docs/api/async_hooks.html)

[2]:
[https://nodejs.org/dist/latest-v9.x/docs/api/domain.html](https://nodejs.org/dist/latest-v9.x/docs/api/domain.html)

~~~
emilsedgh
Are domains removed from this release?

~~~
koolba
I haven't see the latest docs yet but I don't think so. They're still there as
of the latest v9.x release so I'd imagine there still in v10.x as well.

~~~
emilsedgh
That's what I thought and good news.

We use domains as continuous local storage. This gives us enough time to have
a stress-free migration to async hooks.

~~~
koolba
Yep it's still there. Looks like we're good until at least the end of that LTS
release, Nov 2020!

------
dcgudeman
No mention of ECMAScript Modules?

~~~
demurgos
There was no big change on the ESM side. They are still experimental and
require the `.mjs` extension. The only change around modules that I am aware
of is the update of the V8 engine. It adds support for `import.meta`.

There are still ongoing discussions around Node's ESM support, you can follow
the modules repo [0].

[0]: [https://github.com/nodejs/modules](https://github.com/nodejs/modules)

------
alvis
OpenSSL 1.1 finally arrives at Node 10.

