Lost in Node.JS. Where to begin
25.06
Learn anything is always hard. To feel lost and don’t know where to begin.
To help you, who wants (and will) develop in Node.JS, we did this little step-by-step with everything you need to know to find yourself in this runtime created by Ryan Dahl, in 2009, and one of the most used web technologies today.
One step behind
Before we start to talk about Node.JS, is important to know that is not a framework. It’s a runtime. A set of libraries written in JavaScript that allows the execution of the JavaScrip code at the server. A server-side technology
Have you looked at the image above? Take a look again….V8. It’s a JavaScipt’s engine created by Google, written in c++ and used in Chrome.
Every JavaScript’s code you create will be interpreted by V8. Meaning that is really fast. Only 17% slower than an optimized c++ code.
We did a little explanation about what Node.JS really is and a brief immersion at the runtime guts. Now it’s time to talk what you are looking for*: How to begin with Node.JS
*Hold on! We know that what really matter is to practice. After all is the best way to learn something. But you need to know how things work. This will give you more knowledge and will be easier to put in practice what you will learn. So, you must read the official documentation. Although is much more focus in API, still a good read to learn about the use of the debugger, for example. Will be useful too to take a look at V8 and how Event Loop works. At least, the book “Hands-on Node.JS“, from Paulo Teixeira, is excellent and one of the few focused at the core of Node.JS
The Hitchhiker’s Guide to the JavaScript Galaxy
Well, here you are, young man hungry for knowledge .
You’re a freshman (this is not a bad thing) and lost. This guide will help you. We don’t want you lost in this giant galaxy.
We separated the guide in Suns.
Sun 1
Main quest
Sun 2
Main quest
Objective: Create your first web application with Express.
For this one you will need:
Side quest
If you are still at JavaScript Leve 1:
If you already completed some quests with JavaScript:
If that was your first “Hello World” your next mission will sound challenging. Complete all previous side quests.
Sun 3
Main quest
Create an application with Express and MongoDB.
Let’s do like this:
Completing the tutorials you will have a strong base to create CRUDs with Express and MongoDB. But, like almost every tutorial, lack the better structure of the application. Want to know how to structure? Do this side quest.
Side quest
Sun 4
Main quest
Recreate the RSS-Feed-Emitter
It’s time to learn new practices and to do this we have Filipe’s tutorial. It’s a great one because goes beyond “make work” and give you the tools to make simple things like publishing at NPM and even more complex tasks like how to test your application.
It’s a 19 steps (counting the bonus parts) tutorial. Follow all steps and, if you do know something, check the links that you can find in the tutorial. https://github.com/filipedeschamps/rss-feed-emitter/issues/119
Side quest
Sun 5
Main quest
Publish your application with PM2
It’s time to publish the application created on Sun 3. To publish we will use PM2. Just follow this steps and the process.json will be created. You will also learn a variety of commands that PM2 have.
Side quest
Wrapping up
If you conclude every quest, side quest included, congratulations!! You now have a strong base to start your project with Node.JS. You may be noticed that most part, until here, we used Express.
Like we said at the beginning, is good to start with it. When you use Node.JS you will use together some web framework.
Don’t forget to take a look at Hands-On. It will go further at the Node’s core. Besides that, you can make different applications, like a chat with Socket.IO or desktop with Electron.
You are going on an adventure…
Na Vizir Talks #32, o Assis Neto falou sobre suas impressões do Deno.JS, veja o vídeo...
💡 #aprendi é um canal interno onde os Vizires compartilham aprendizados do dia a dia...
💡 #aprendi é um canal interno onde os Vizires compartilham aprendizados do dia a dia...
💡 #aprendi é um canal interno onde os Vizires compartilham aprendizados do dia a dia...
💡 #aprendi é um canal interno onde os Vizires compartilham aprendizados do dia a dia e...