education icon indicating copy to clipboard operation
education copied to clipboard

What are the best resources to understand how the internals of Node.js work?

Open daviddias opened this issue 8 years ago • 11 comments

I've been asking myself "what is the best way to learn the Node.js internals today?" and in all my searches,with the exception of the libuv book, I've been only able to find resources on how to use Node.js.

What is the best way to understand how the code is organized and the internals design from a technical standpoint? I've been using Node.js for so long now and I realized.

daviddias avatar Feb 03 '17 16:02 daviddias

I think one reason for this lack of resources might be that for the most part, Node.js is just a ton of glue code that holds libuv, V8, openssl, zlib, etc. together and makes their functionality available to JS land, so there isn’t actually terribly much going on inside of Node itself.

What is the best way to understand how the code is organized and the internals design from a technical standpoint?

Not sure, but if you have individual questions that are specific enough, you can ask them at https://github.com/nodejs/help, or maybe #node-dev on Freenode (depends on the question, I guess)…

addaleax avatar Feb 03 '17 16:02 addaleax

@diasdavid Thank you for asking this question here! I'd love to start an FAQ that logs these sorts of Q/A after we find some good responses. Sort of like StackOverflow but actually exists within our CoC and our awesome contributors' view.

@addaleax If I started an FAQ in Education with these kinds of questions and listed your answer, do you think that would be a good start? There are a lot of folks who don't know that even -this- is an option, but I don't want to inundate those mediums if it would be too many people going there at once.

hackygolucky avatar Feb 06 '17 02:02 hackygolucky

@hackygolucky Just to be sure we’re talking about the same thing: Are you thinking about a FAQ on Node.js internals, or a FAQ with questions that specifically ask for resources (likes this one); or something completely different? :D

addaleax avatar Feb 07 '17 12:02 addaleax

ah @addaleax I was thinking of the latter: questions that ask for resources :)

hackygolucky avatar Feb 07 '17 23:02 hackygolucky

Node.js is just a ton of glue code that holds libuv, V8, openssl, zlib, etc.

:) I believe that there is still space for a resource that explains how things get glued together and why, as in: what this piece offers to the puzzle and why A instead of B.

Sort of like StackOverflow but actually exists within our CoC and our awesome contributors' view.

Yes please :) Just being able to search would be stellar and save a lot of duplicates/time spent.

daviddias avatar Feb 11 '17 19:02 daviddias

I've been involved in similar documentation efforts before but the results are usually not very good and tends to go stale over time as the code base it describes evolves.

It's a perennial problem for code-centric projects: the people that need documentation can't write it, while the people that can don't need it (and therefore aren't very motivated to write it.)

An approach I had some success with at StrongLoop was writing up a weekly changelog of development in and around core, with the occasional Cliff's note on how and why a particular change was implemented.

It got us a good amount of page views and it's been the (or at least a) starting point for some contributors. The downside is that a good write-up takes appreciable time, it's no five minute job.

bnoordhuis avatar Feb 11 '17 21:02 bnoordhuis

@bnoordhuis Something like http://v8project.blogspot.com would be ideal.

kevin2r avatar Feb 12 '17 04:02 kevin2r

Definitely we can't forget node-gyp and v8.

adrianofsp avatar Feb 27 '17 17:02 adrianofsp

As many others already answered, the best way is to read the source code, I've just started to dig and dive deeper into V8 and this might help you: https://medium.com/@vardanator/node-js-v8-internals-an-illustrative-primer-83766e983bf6

vardanator avatar Nov 11 '17 01:11 vardanator

I think is good to add two more:

https://github.com/danbev/learning-libuv

https://github.com/danbev/learning-nodejs

helio-frota avatar Jan 19 '18 14:01 helio-frota

I think for me, this book was alot beneficial to move forward: https://github.com/libuv/libuv

ilivestrong avatar Jan 02 '19 11:01 ilivestrong