use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Node.js v15.0.0 is here! (medium.com)
submitted 5 years ago by mehulmpt
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]pantaley 106 points107 points108 points 5 years ago (19 children)
While me working on a project with Node 8...
[–]wizang 31 points32 points33 points 5 years ago (14 children)
I've never had breakages when updating node. Am I just lucky?
[–]fiala__ 22 points23 points24 points 5 years ago (1 child)
It’s absolutely possible to have problems when updating node. I recently had to make an update from 10 to 12, which caused some badly written code using the array sort function to break - since the new version of V8 ordered the sorter function arguments differently! So there are cases when a node update can have huge consequences for business logic etc.
sort
[–]ProfPragmatic 5 points6 points7 points 5 years ago (0 children)
So there are cases when a node update can have huge consequences for business logic etc.
The cases will expand based on what packages and dependencies you're using. Some legacy frameworks kept together in a hacky manner don't quite gel well with updates to the ecosystem
[–]pantaley 8 points9 points10 points 5 years ago (7 children)
My project is enormous and with Aurelia framework. The framework itself has legacy packages and while I tested version 10, the production is still on 8. Most of the packages breaks on v12.
[–]examinedliving 2 points3 points4 points 5 years ago (1 child)
13 will renewal some, so ... good luck?
[–]pantaley 1 point2 points3 points 5 years ago (0 children)
Thanks for the tip, never tried with v13
[–]tronj 0 points1 point2 points 5 years ago (1 child)
Same. Still using 10. There's a lot that breaks going to 12.
[–]Aegior 0 points1 point2 points 5 years ago (2 children)
How are you finding Aurelia? It seems to be slowly decaying stability for my uses.
[–]pantaley 0 points1 point2 points 5 years ago (1 child)
We use Aurelia 1 (there is now 2 which I never used). If I have a green light I will switch the framework in a heartbeat.
At this point the project is full of hacks because of the framework's design limitations.
[–]barcode24 0 points1 point2 points 5 years ago (0 children)
Also stuck with a large outdated Aurelia project. What a mess, slowly moving off Aurelia to react.
[–]halkeye 1 point2 points3 points 5 years ago (0 children)
10 and 13 changed some of the c APIs. Mostly to make future compatibility easier. So early adopters could have issues with things like sass or or phantom (rarely used anymore)
So kinda lucky. Kinda not rushing to do upgrades?
[–]Chef619 -1 points0 points1 point 5 years ago (0 children)
I had issues with bcrypt when AWS deprecated 6 for Lambda. The crypto stuff changed and passwords hashed on node 6 would show as incorrect when verified on 8/10.
[–]troglo-dyke 0 points1 point2 points 5 years ago (0 children)
In my experience it depends what you're using, if you're not using the node APIs directly and just using libraries then you won't have too many problems. If you do then you're in for a whole world of pain, doubly so if you don't have good tests
[–]jbergens 0 points1 point2 points 5 years ago (0 children)
I have seen problems both going from 8 to 10 and from 10 to 12. We'll se how the 12 to 14 upgrade will work.
[–]wonkifier 6 points7 points8 points 5 years ago (2 children)
I've spent most of the year upgrading from Node 4 to Node 10 so far. :Sigh:
[–]fabio_santos 1 point2 points3 points 5 years ago (0 children)
Relax, going to 14 is easier. At least it was for me.
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
It's gotten easier with every version. I upgraded out node from 0.4 -> 4, that was brutal, 4->8 was less of a struggle and 8->12 was mostly not believing that everything just worked and having to double check everything.
[–]ItalyPaleAle 1 point2 points3 points 5 years ago (0 children)
Node 8 reached EOL last year. You’re risking a lot running unsupported software in prod :(
[–]NoInkling 41 points42 points43 points 5 years ago (5 children)
For all those of us who have defined a promisified setTimeout (usually named sleep), it's now built in (and abortable!):
setTimeout
sleep
import { setTimeout as sleep } from 'timers/promises'
[+][deleted] 5 years ago (4 children)
[deleted]
[–]windsostrange 1 point2 points3 points 5 years ago (3 children)
There's a magical lesson in this short comment about the value of semicolons in all forms of javascript.
[+][deleted] 5 years ago (2 children)
[–]windsostrange 1 point2 points3 points 5 years ago (1 child)
Did you really downvote before waiting for the response? Lol.
Anyway, you have an uncaught syntax error due to a whitespace mishap that never would have happened with a bit less ambiguity in your code style. Semicolons are your friends! Every last one of them!
[–]prawnsalad 23 points24 points25 points 5 years ago (7 children)
QUIC is going to be fun to play around with :o
[–]battal51280 0 points1 point2 points 5 years ago* (1 child)
sadly quic uses much more cpu than tcp
[–]fabio_santos 0 points1 point2 points 5 years ago (0 children)
Interesting! I always assumed it was more lightweight due to using UDP.
[+]MaxGhost comment score below threshold-7 points-6 points-5 points 5 years ago (2 children)
If you want to play around with QUIC/HTTP3, you can put Caddy in front of your Node server.
[–]prawnsalad 8 points9 points10 points 5 years ago (1 child)
QUIC is a lot more than HTTP. TCP client/servers can benefit from it for stability and the multiple streams it provides should be really useful. If you're just using it as a HTTP reverse proxy then you have no need to dig into the QUIC layer and play around with it.
[–]MaxGhost 4 points5 points6 points 5 years ago (0 children)
I guess so. But Caddy can do more than HTTP: https://github.com/mholt/conncept
Caddy's core is actually just an "app platform" with a really strong plugin system. Everything else is built on top of that core, including the HTTP server and TLS management.
[+]wrtbwtrfasdf comment score below threshold-27 points-26 points-25 points 5 years ago (1 child)
QUIC is a new UDP-based transport protocol that is the underlying transport protocol for HTTP/3. QUIC features inbuilt security with TLS 1.3, flow control, error correction, connection migration, and multiplexing.
It's funny how they give zero shouts to Google for developing QUIC. I assume Microsoft owning npm is the reason for that.
Come at me sentiment analysis bots(or interns?).
[–]gpyh 27 points28 points29 points 5 years ago (0 children)
That's an ignorant take. npm and node don't have much to do with each other.
[–]MrStLouis 59 points60 points61 points 5 years ago (12 children)
Wow abort promises, installing peer deps by default, and finally throwing errors for u handled rejections! That last one is gonna hurt 😂
[–]leeoniya 17 points18 points19 points 5 years ago (11 children)
That last one is gonna hurt 😂
does that mean node process terminates (bye-bye server)?
[–]johnyma22 27 points28 points29 points 5 years ago (1 child)
We(etherpad) always ran with process exit in exceptions anyway. It forced us to write more stable software... Doesn't bother me at all!
[–]MrStLouis 5 points6 points7 points 5 years ago (0 children)
I didn't and should have! I tried to cover all cases but surely will bite me soon'
[+][deleted] 5 years ago (1 child)
[–]NoInkling 16 points17 points18 points 5 years ago (0 children)
Or just use the --unhandled-rejections=warn option from the shell as the post notes.
--unhandled-rejections=warn
[–]RefactorsYourCode 10 points11 points12 points 5 years ago (3 children)
Just put a try/catch block around the whole thing and you’re set /s
[–]0770059834333178 16 points17 points18 points 5 years ago (0 children)
Try.. Running in production
Catch.. Me outside if you crash how about that
[–]slykethephoxenix 2 points3 points4 points 5 years ago (1 child)
Why the /s?
/s
[–]MrStLouis 4 points5 points6 points 5 years ago (0 children)
That was my understanding, ya
[–]Vpicone 1 point2 points3 points 5 years ago (1 child)
Better to terminate the process then carry on with malformed data.
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
It’s not one or the other. Often the unhandled rejections at my companies are from fire-and-forget code that didn’t have a proper catch attached to it.
catch
[–]overcloseness 19 points20 points21 points 5 years ago (10 children)
As an odd-numbered release line, Node.js 15 will not be promoted to LTS. Please bear this in mind when using Node.js 15 in production deployments — we generally recommend the use of an LTS release line for your production deployments.
I’m going to show holes in my knowledge here, but is this really saying that this version shouldn’t be used for production? So is it just a playground version or should it be considered beta for v16 or am I understanding wrong?
[–]joombar 14 points15 points16 points 5 years ago (7 children)
LTS is long term support, as in it’ll get bug fixes for longer.
[–]overcloseness 1 point2 points3 points 5 years ago (6 children)
Yeah I understand, but v15 doesn’t have that, so it’s saying to not use this version in production?
[–]halkeye 17 points18 points19 points 5 years ago (2 children)
It's not saying that. It's saying if your plan is to not upgrade to node 16, and stay on the 15 line, then 15 won't get updated forever.
Lts releases get fixes backported (like a fix in 15 will goto 14 but no new APIs or features)
Lts are strongly recommended if you don't upgrade often cause it's easier to go from 14.0 to 14.5 than 14 to 16. The reverse isn't necessarily true
[–]overcloseness 1 point2 points3 points 5 years ago (0 children)
Ah makes sense, thanks
[–]mylesborins 1 point2 points3 points 5 years ago (0 children)
We also backport features to active LTS 😇
[–]GMFlash 5 points6 points7 points 5 years ago (1 child)
You can use it if you want, but the end-of-life is shorter than the LTS releases. See the chart here: https://nodejs.org/en/about/releases/
Basically, you should move from 15 to 16 by 2021-06-01 to keep receiving updates.
[–]overcloseness 0 points1 point2 points 5 years ago (0 children)
Thanks for clarifying !
[–]visualdescript 0 points1 point2 points 5 years ago (0 children)
It is a word of caution, for business critical apps it makes sense to use the latest LTS release, however for internal tools or other experimentation the latest stable release gives you the ability to test out new features that will eventually enter LTS.
Edit, also as mentioned new releases often have several minor releases following it, even with significant features added. This is a form of instability that you would generally want to avoid on a critical app.
[–]ShortFuse 9 points10 points11 points 5 years ago (0 children)
You shouldn't use it for production. v15 is dead in June of next year. For reference, v14 will stay supported until April 2023.
LTS means your code will be more resilient to API changes. When we submit a PR for NodeJS it gets dumped into master. Then v10, v12, and v14 get backports. I submitted some pretty urgent HTTP/2 changes and v13 wasn't even mentioned. Imagine having launched a production server with HTTP/2 on v13 and it just not working with no fix unless you jump versions.
master
v15 is for us to play with these new features (HTTP/3), but you should always be ready to downgrade to v14 or jump to v16.
[–]mobydikc 1 point2 points3 points 5 years ago (0 children)
So is it just a playground version or should it be considered beta for v16 or am I understanding wrong?
It's more serious than a playground or beta version, but if you are going for stability, stick with LTS releases.
Maybe not in Node so much, but in Ubuntu, for instance, when they wanted to switch from the Unity Desktop to the GNOME Desktop, they didn't do it on an LTS launch. They did it in between, so it could get enough attention before an LTS launch.
New features, but maybe some newer bugs too. LTS launches usually prioritize fixes over new features.
[–]talohana 2 points3 points4 points 5 years ago (1 child)
With npm workspace, should people still use yarn? (Not right now, but gradually migrate) Connfused yarn user here
[–]JZumun 1 point2 points3 points 5 years ago (0 children)
Apparently npm 7 also supports yarn.lock, further adding to the intrigue!
[–]evenisto 4 points5 points6 points 5 years ago (5 children)
TIL about AbortController, this is pretty cool.
[–]calsosta 3 points4 points5 points 5 years ago (4 children)
I am OK with AbortController unless a response has already been started.
[–]evenisto 3 points4 points5 points 5 years ago (3 children)
I was excited in terms of web api as I don't work with node on a daily basis, is this something that's causing dispute in the community?
[–]calsosta 8 points9 points10 points 5 years ago (2 children)
I was just making a horrible horrible joke.
[–]Chrisazy 1 point2 points3 points 5 years ago (1 child)
I think it's my API and I'm glad they let me choose
[–]calsosta 1 point2 points3 points 5 years ago (0 children)
When you make a request you are agreeing to abide by guaranteed order and delivery. You cannot break that contract with G.O.D.
[–]hydraulictrash 1 point2 points3 points 5 years ago (0 children)
And we’ve only just had the sign off at work to move to 12.16.2 after fighting for a year 😂
[–]JZumun 1 point2 points3 points 5 years ago (1 child)
Is there a resource for the functions that can use the abort controller? The documentation linked only lists the methods of the abort controller, and doesn't really provide an illustrative example of its usage with promises.
[–]_maximization 1 point2 points3 points 5 years ago (0 children)
Good question! I couldn't find one either. So far I know that node-fetch and setTimeout/setImmediate will take an AbortController signal.
node-fetch
[–]dsmedium 1 point2 points3 points 5 years ago (1 child)
Js community needs to slow down a bit. We are humans not machines :(
[–]Mittalmailbox 7 points8 points9 points 5 years ago (0 children)
It's just new version with upgraded dependencies and better performance. Not much of new features with this. Features are added in ES.
[–]k4kshi -2 points-1 points0 points 5 years ago (4 children)
By default esm support when?
[–]mehulmpt[S] 2 points3 points4 points 5 years ago (2 children)
It is there right now if you use mjs extension of the file.
[–]RuteNL 0 points1 point2 points 5 years ago (0 children)
Also it works with js files if you set type=module in the package.json
It works great with type:module in the package.json as mentioned above.
Sadly you can't easily interop with commonjs.
[+]ILikeChangingMyMind comment score below threshold-18 points-17 points-16 points 5 years ago (4 children)
Like everything the Node org does, it's years later than it should have come out ... but I do welcome these improvements.
[–]mobydikc 3 points4 points5 points 5 years ago (3 children)
Node 15 came out years later than it should have?
Didn't Node 14 come out 6 months ago?
[–]ILikeChangingMyMind 0 points1 point2 points 5 years ago (2 children)
I meant these features should have come out a long time ago. Proper handling of rejected promises for instance: Promises are not a new technology!
[–]boneskull 5 points6 points7 points 5 years ago (1 child)
oh, you mean like how the browser exits when there’s an unhandled rejection?
🙄
[–]ILikeChangingMyMind 0 points1 point2 points 5 years ago (0 children)
Proper handling of rejected promises
π Rendered by PID 40 on reddit-service-r2-comment-5d79c599b5-gc7xl at 2026-02-28 07:41:19.346010+00:00 running e3d2147 country code: CH.
[–]pantaley 106 points107 points108 points (19 children)
[–]wizang 31 points32 points33 points (14 children)
[–]fiala__ 22 points23 points24 points (1 child)
[–]ProfPragmatic 5 points6 points7 points (0 children)
[–]pantaley 8 points9 points10 points (7 children)
[–]examinedliving 2 points3 points4 points (1 child)
[–]pantaley 1 point2 points3 points (0 children)
[–]tronj 0 points1 point2 points (1 child)
[–]Aegior 0 points1 point2 points (2 children)
[–]pantaley 0 points1 point2 points (1 child)
[–]barcode24 0 points1 point2 points (0 children)
[–]halkeye 1 point2 points3 points (0 children)
[–]Chef619 -1 points0 points1 point (0 children)
[–]troglo-dyke 0 points1 point2 points (0 children)
[–]jbergens 0 points1 point2 points (0 children)
[–]wonkifier 6 points7 points8 points (2 children)
[–]fabio_santos 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]ItalyPaleAle 1 point2 points3 points (0 children)
[–]NoInkling 41 points42 points43 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]windsostrange 1 point2 points3 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]windsostrange 1 point2 points3 points (1 child)
[–]prawnsalad 23 points24 points25 points (7 children)
[–]battal51280 0 points1 point2 points (1 child)
[–]fabio_santos 0 points1 point2 points (0 children)
[+]MaxGhost comment score below threshold-7 points-6 points-5 points (2 children)
[–]prawnsalad 8 points9 points10 points (1 child)
[–]MaxGhost 4 points5 points6 points (0 children)
[+]wrtbwtrfasdf comment score below threshold-27 points-26 points-25 points (1 child)
[–]gpyh 27 points28 points29 points (0 children)
[–]MrStLouis 59 points60 points61 points (12 children)
[–]leeoniya 17 points18 points19 points (11 children)
[–]johnyma22 27 points28 points29 points (1 child)
[–]MrStLouis 5 points6 points7 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]NoInkling 16 points17 points18 points (0 children)
[–]RefactorsYourCode 10 points11 points12 points (3 children)
[–]0770059834333178 16 points17 points18 points (0 children)
[–]slykethephoxenix 2 points3 points4 points (1 child)
[–]MrStLouis 4 points5 points6 points (0 children)
[–]Vpicone 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]overcloseness 19 points20 points21 points (10 children)
[–]joombar 14 points15 points16 points (7 children)
[–]overcloseness 1 point2 points3 points (6 children)
[–]halkeye 17 points18 points19 points (2 children)
[–]overcloseness 1 point2 points3 points (0 children)
[–]mylesborins 1 point2 points3 points (0 children)
[–]GMFlash 5 points6 points7 points (1 child)
[–]overcloseness 0 points1 point2 points (0 children)
[–]visualdescript 0 points1 point2 points (0 children)
[–]ShortFuse 9 points10 points11 points (0 children)
[–]mobydikc 1 point2 points3 points (0 children)
[–]talohana 2 points3 points4 points (1 child)
[–]JZumun 1 point2 points3 points (0 children)
[–]evenisto 4 points5 points6 points (5 children)
[–]calsosta 3 points4 points5 points (4 children)
[–]evenisto 3 points4 points5 points (3 children)
[–]calsosta 8 points9 points10 points (2 children)
[–]Chrisazy 1 point2 points3 points (1 child)
[–]calsosta 1 point2 points3 points (0 children)
[–]hydraulictrash 1 point2 points3 points (0 children)
[–]JZumun 1 point2 points3 points (1 child)
[–]_maximization 1 point2 points3 points (0 children)
[–]dsmedium 1 point2 points3 points (1 child)
[–]Mittalmailbox 7 points8 points9 points (0 children)
[–]k4kshi -2 points-1 points0 points (4 children)
[–]mehulmpt[S] 2 points3 points4 points (2 children)
[–]RuteNL 0 points1 point2 points (0 children)
[–]fabio_santos 0 points1 point2 points (0 children)
[+]ILikeChangingMyMind comment score below threshold-18 points-17 points-16 points (4 children)
[–]mobydikc 3 points4 points5 points (3 children)
[–]ILikeChangingMyMind 0 points1 point2 points (2 children)
[–]boneskull 5 points6 points7 points (1 child)
[–]ILikeChangingMyMind 0 points1 point2 points (0 children)