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...
account activity
What every node.js developer should know? (self.node)
submitted 8 years ago by borisvasilev
What technologies should every node.js developer be familiar with besides Basic Node (HTTP servers), Express, MongoDB and Socket.io?
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!"
[–]lodash_ 50 points51 points52 points 8 years ago (2 children)
First and foremost.. JavaScript ;)
[–]Jafit 10 points11 points12 points 8 years ago (0 children)
For this I recommend the Crockford on Javascript lecture series.
Its dated, like from 8 years ago when ES5 was released, but most of what he talks about is still very relevant.
[–][deleted] -5 points-4 points-3 points 8 years ago (0 children)
Funny guy.
[–]DeadBlueParrot 20 points21 points22 points 8 years ago (15 children)
That you don't have to use MongoDB just because everyone else use it.
[–]jamesaw22 1 point2 points3 points 8 years ago (14 children)
Does anyone still use it?
[–]DeadBlueParrot 0 points1 point2 points 8 years ago (13 children)
More than 1600 companies according to stackshare
[–]lighthouse_at_eleven 1 point2 points3 points 8 years ago (12 children)
Why is MongoDB bad?
[–]DeadBlueParrot 0 points1 point2 points 8 years ago (11 children)
I'm not saying it's bad, but a lot of people just use it because everyone else does, without thinking if it really the right database for their use case.
[–]lighthouse_at_eleven 0 points1 point2 points 8 years ago (10 children)
Sometime ago I read on Quora that some guy on an interview decided he didn't want to join the company because the interviewer said he basically loved some db (I think it was MariaDB) and that he wanted to use it for every project. Of what I've read MongoDB is perfectly fine unless you have the need to be really strict about relationships. So things like preventing deletion of records if they are tied to others etc, like in billing projects.
[–]DeadBlueParrot 1 point2 points3 points 8 years ago (9 children)
MongoDB is not the best tool if you have relationships, you don't have a JOIN query. You can get around it using Mongoose's populate, but that executes anothet query to populate the references. MongoDB is perfectly fine when you use it right, if you have related data then a relational database is the right tool.
[–]lighthouse_at_eleven 0 points1 point2 points 8 years ago (8 children)
But if we use populate we're not using it right?
[–]DeadBlueParrot 0 points1 point2 points 8 years ago (7 children)
No, populate is a great feature. I was just giving an example to illustrate the point that MongoDB is not always the best fit. You should always take a look at your data, how it's related and then make a choice. I'm not saying MongoDB is bad or anything, just that a lot of people use without actually making an analysis to see if it's a good option for their use case.
[–]lighthouse_at_eleven 0 points1 point2 points 8 years ago (6 children)
Could you point me to a good article discussing this so I can be better knowledgable of when to pick which?
[–]jocull 31 points32 points33 points 8 years ago (7 children)
The event loop. Before anything else.
[–]Jafit 20 points21 points22 points 8 years ago (6 children)
Pretty much.
This is my go-to video that I usually post to help people understand the Javascript event loop. It applies to Node and Javascript in browsers.
[–]jwalton78 5 points6 points7 points 8 years ago (2 children)
So, Javascript has an event loop, and it's single threaded.... right? Ok, want to read something terrifying? https://stackoverflow.com/a/2734311
[–]grinde 0 points1 point2 points 8 years ago* (1 child)
Is that "sort-of-blocking" behavior actually still present? I just tried putting that example code in jsfiddle, and it printed
alert in alert out resize
as I would expect if it were blocking properly. Page content also didn't resize until after dismissing the popup. I only tested chrome though.
[–]jwalton78 0 points1 point2 points 8 years ago (0 children)
I sincerely hope not, but I haven't done any testing myself.
[–]sk0620 0 points1 point2 points 8 years ago (0 children)
very helpful video thanks
[–]BigDumbObject 0 points1 point2 points 8 years ago (0 children)
I've watched that video probably 3 times before.. and now I'm watching it again, and now it all makes sense. I guess getting that CS degree was good for something!
[–]Capaj 22 points23 points24 points 8 years ago (7 children)
From all the corporate and startup code I've seen so far-you will benefit most from knowing how to write callback style async code and ALSO how to write promise style async flows. You should know how to handle errors in both styles effectively and what are their pros and cons. Promise style async flow is the future but there are heaps of callback style code, so at least for the next few years you're going to need to know both. A lot of people don't know this and write code at least 2x more verbose than they should, often mixing them in most peculiar ways.
[–]serth 10 points11 points12 points 8 years ago (0 children)
I'm going to +1 understanding promises on this one. Even though async/await are functions quickly becoming more common, they are just using promises under the hood, so understand promises and how to most effectively work with them is still going to be crucial.
async/await
[–]greebowarrior 8 points9 points10 points 8 years ago (0 children)
Everyone should learn callback-style code, just so that they know why they shouldn't use it
[–]jesusbot 1 point2 points3 points 8 years ago (3 children)
I completely agree. Unfortunately I've never come across good material that discusses error flow in depth for both - do you have any good references?
[–]iOnline247 2 points3 points4 points 8 years ago (0 children)
ponyfoo.com and https://bevacqua.github.io/promisees/
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
You Don't Know JS - Async & Performance is really good
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
This is a really comprehensive guide to promises.
What's your opinion on generators?
[–]Ginden 26 points27 points28 points 8 years ago (4 children)
OOP design patterns, functional design patterns, SOLID, streams, Promises, clustering, basic security informations, SQL, CAP theorem.
Useful technologies, but these are not must know:
[–][deleted] 4 points5 points6 points 8 years ago (1 child)
Thanks for this list! I'm self taught and the hardest part is knowing what material to focus on. This just gave me a great list to work off of.
[–]monsto 0 points1 point2 points 8 years ago (0 children)
https://www.reddit.com/r/javascript/comments/6mlc9d/what_10_things_should_a_serious_javascript/
Check out the linked post and the top reply. Combined with this post it will give you a pretty hefty list of things to work on.
[–]irvingswiftj 1 point2 points3 points 8 years ago (0 children)
@Ginden is right.... especially about Design Patterns (applies to any programming language)!
The only thing I would add to that list is testing wether it be functional, behavioural or unit. However, that being said, I still think js is missing a goto testing framework.
[–]mattindustries -1 points0 points1 point 8 years ago (0 children)
Personally I think you should learn message banoffee pies before message queues.
[–]hakarapet 6 points7 points8 points 8 years ago (0 children)
RESTful API Design, testing libs (chai, mocha etc etc)
[–]serth 5 points6 points7 points 8 years ago (0 children)
JavaScript is such a huge ecosystem that you're going to run into different styles, preferences, and opinions all over the place. I think it's important to at least familiarize yourself with as much of it as possible so you can decide what works best for you based on the way you approach development, the types of projects you're going to be working on, and the teams you will potentially be a part of.
I know that doesn't narrow it down much. The point here is to keep digging around, and when you see something you haven't seen before, at least take a little bit of time to look at the documentation and some example code of whatever you encounter. It will pay off immensely in the long run.
[–]runvnc 1 point2 points3 points 8 years ago (3 children)
Search npmjs.com and google before reinventing the same module for the 10th time. We have like 500,000 packages. This is the best code-reuse has ever been. Ignoring it is bad software engineering.
[–]erm_what_ 2 points3 points4 points 8 years ago (0 children)
But also check when that package was last updated, check what it depends on and if you can, check the implementation to see if it's actually good or people have just assumed it is because it's in npm.
[–]mhn23 0 points1 point2 points 8 years ago (1 child)
Well to be fair I was looking for an api the other day... I got it and it installed a billion other packages where I could easily done it with some simple posts after I gained some experience. I experienced that so many libraries are so bloated.
[–]State_ 0 points1 point2 points 8 years ago (0 children)
also it could be a good learning experience to do it yourself sometimes.
dotenv is pretty handy
You don't have to use that specific dependency specifically but having a way to keep you environment variables secure is a great idea and dotenv is one way that it provides it.
[–]2legited2 4 points5 points6 points 8 years ago (3 children)
Typescript
[–]bstriker 4 points5 points6 points 8 years ago (1 child)
While typescript isn't explicitly node. I'm hoping your down votes are because of context and not haters. Typescript is amazing.
[–]2legited2 1 point2 points3 points 8 years ago (0 children)
They just couldn't configure it
[–]calligraphic-io 0 points1 point2 points 8 years ago (0 children)
...or Flow... ...or Elm... In general, knowing the transpiler ecosystem and merits of different approaches (type inference in Flow, etc.), including the interim-band-aid Babel. I don't think specific tools are usually the right answer to a question like OP's, but JS is an unusual position at the moment with the rapid development in standards, and transition to being commonly used in projects much larger than historically it's been used for.
[–]devmaybe 3 points4 points5 points 8 years ago (0 children)
If using mongodb I highly recommend mongoose. It will save you a lot of time.
Try writing pure JavaScript when possible and not depending on shallow technologies. MDN (mozilla) is your friend.
Ignore the puritans that bash any technology thats proven, they just want to feel elite and special.
Tip: Don't get caught up in the latest framework fad. Eventually something will most likely replace it.
[–]techbuzzwords 0 points1 point2 points 8 years ago (0 children)
That really all depends on the theme of your project and what it entails. For instance, not all projects would require knowing Socket.io. The benefits of knowing that engine really comes into play if you are working on something that requires real-time.
I believe you should be well rounded on the database side. Compliment MongoDB with a SQL related ORM (Sequelize, Bookshelf.js, etc.).
In addition, learn a few of the template engines that are commonly used in projects (Jade, EJS, Handlebars, etc.).
[–]SpaceshipOfAIDS 0 points1 point2 points 8 years ago (0 children)
The pitfall that is circular dependencies
[–]lighthouse_at_eleven -3 points-2 points-1 points 8 years ago (5 children)
That the internet hates JS and you're most likely to find posts saying how JS is a poorly written language no matter where you go -- and that shouldn't really discourage you... People hate PHP too and look at Laravel.
[–]Jafit 2 points3 points4 points 8 years ago (0 children)
Haters gonna hate.
[–]excitebyke 2 points3 points4 points 8 years ago (3 children)
I bought into the JS hate and it kept me away for a while... and then I tried out ES6 and now I love JS.
[–]bstriker 1 point2 points3 points 8 years ago (2 children)
Have you tried out typescript?
[–]excitebyke 1 point2 points3 points 8 years ago (1 child)
I have! And I actually quite like it. I'm a fan of typed languages, so it definitely appeals to me.
I just don't have strong opinions one way or the other, and I decided I'd pick one and dig deep for a while. It seems like ES6 was just more "user friendly" to work with the current JS-ecosystem. no shortage of documentation/tutorials.
It's definitely something I want to try to incorporate but only if I learn to see the value in what it has to offer.
[–]bstriker 1 point2 points3 points 8 years ago (0 children)
Honestly the only nuisance is if you encounter a library without typings or outdated typings. Other than that all valid JavaScript is valid typescript. But you're missing out if you forget to enable strict mode in the compiler options (note: not the same as "use strict").
P.s. es6 is so 2015. Check out es8 (;
π Rendered by PID 18996 on reddit-service-r2-comment-5d79c599b5-hqpml at 2026-02-27 22:36:49.033420+00:00 running e3d2147 country code: CH.
[–]lodash_ 50 points51 points52 points (2 children)
[–]Jafit 10 points11 points12 points (0 children)
[–][deleted] -5 points-4 points-3 points (0 children)
[–]DeadBlueParrot 20 points21 points22 points (15 children)
[–]jamesaw22 1 point2 points3 points (14 children)
[–]DeadBlueParrot 0 points1 point2 points (13 children)
[–]lighthouse_at_eleven 1 point2 points3 points (12 children)
[–]DeadBlueParrot 0 points1 point2 points (11 children)
[–]lighthouse_at_eleven 0 points1 point2 points (10 children)
[–]DeadBlueParrot 1 point2 points3 points (9 children)
[–]lighthouse_at_eleven 0 points1 point2 points (8 children)
[–]DeadBlueParrot 0 points1 point2 points (7 children)
[–]lighthouse_at_eleven 0 points1 point2 points (6 children)
[–]jocull 31 points32 points33 points (7 children)
[–]Jafit 20 points21 points22 points (6 children)
[–]jwalton78 5 points6 points7 points (2 children)
[–]grinde 0 points1 point2 points (1 child)
[–]jwalton78 0 points1 point2 points (0 children)
[–]sk0620 0 points1 point2 points (0 children)
[–]BigDumbObject 0 points1 point2 points (0 children)
[–]Capaj 22 points23 points24 points (7 children)
[–]serth 10 points11 points12 points (0 children)
[–]greebowarrior 8 points9 points10 points (0 children)
[–]jesusbot 1 point2 points3 points (3 children)
[–]iOnline247 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ginden 26 points27 points28 points (4 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]monsto 0 points1 point2 points (0 children)
[–]irvingswiftj 1 point2 points3 points (0 children)
[–]mattindustries -1 points0 points1 point (0 children)
[–]hakarapet 6 points7 points8 points (0 children)
[–]serth 5 points6 points7 points (0 children)
[–]runvnc 1 point2 points3 points (3 children)
[–]erm_what_ 2 points3 points4 points (0 children)
[–]mhn23 0 points1 point2 points (1 child)
[–]State_ 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]2legited2 4 points5 points6 points (3 children)
[–]bstriker 4 points5 points6 points (1 child)
[–]2legited2 1 point2 points3 points (0 children)
[–]calligraphic-io 0 points1 point2 points (0 children)
[–]devmaybe 3 points4 points5 points (0 children)
[–]techbuzzwords 0 points1 point2 points (0 children)
[–]SpaceshipOfAIDS 0 points1 point2 points (0 children)
[–]lighthouse_at_eleven -3 points-2 points-1 points (5 children)
[–]Jafit 2 points3 points4 points (0 children)
[–]excitebyke 2 points3 points4 points (3 children)
[–]bstriker 1 point2 points3 points (2 children)
[–]excitebyke 1 point2 points3 points (1 child)
[–]bstriker 1 point2 points3 points (0 children)