5 ms·
The Node.js Project Introduces Latest Release Line: Node.js 10.x
- alvis 8y agoOpenSSL 1.1 finally arrives at Node 10.
- koolba 8y agoHaving 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.html https://nodejs.org/dist/latest-v9.x/docs/api/async_hooks.htm... [2]: https://nodejs.org/dist/latest-v9.x/docs/api/domain.html https://nodejs.org/dist/latest-v9.x/docs/api/domain.html
- emilsedgh 8y agoAre domains removed from this release?
- koolba 8y agoI 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.
- moltar 8y agoAgreed. It’s the feature I’m most excited about.
- ralusek 8y agoContinuation local storage is a bit fuckie at the oddest times, but has really been a game changer for logging purposes and contextualizing errors within requests better. Given that meaningful stack traces and proper context are by far the weakest part of asynchronous programming, I have hoped to see development on this front above any other aspect of the language.
- talawahdotnet 8y agoGood 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/f8c4452dbb543297a008d3856ef47adb https://gist.github.com/talawahtech/f8c4452dbb543297a008d385...
- michaelsbradley 8y agoWith a little twist, you could make it asynchronously iterable, i.e. if you wanted to iterate over the 'data' chunks/events as they arrive: http://2ality.com/2018/04/async-iter-nodejs.html http://2ality.com/2018/04/async-iter-nodejs.html
- ilaksh 8y agoUse one of the fetch modules from npm.
- untog 8y agoThere'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 8y agoI 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.
- dcgudeman 8y agoNo mention of ECMAScript Modules?
- demurgos 8y agoThere 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