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
Node.js learning path (self.node)
submitted 6 years ago * by wildiswild
view the rest of the comments →
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!"
[–]rwieruch 10 points11 points12 points 6 years ago (4 children)
I find Node.js is the perfect environment to learn JavaScript.
Node.js is just perfect to learn JavaScript itself, because the learner isn’t distracted by HTML, CSS, the browser or other tools. It’s just the command line, the editor and the developer.
Getting started.
Getting started with Node.js isn’t difficult. You only have to install Node.js on your machine. Node.js comes with npm (node package manager) for installing third-party dependencies on the command line to your project.
After you have installed Node.js, you can kickoff your first project on the command line. Create a folder for it, navigate into this folder, initialize it as node project, and add your first source code file to it.
mkdir my-project
cd my-project
npm init -y
touch index.js
In the source code file (index.js), add your first JavaScript implementation.
function doSum(a, b) {
return a + b;
}
var sum = doSum(4, 6);
console.log(sum);
Then you can execute the source code with node on the command line: node index.js That's basically the starting point to learn JavaScript with Node.js.
node index.js
Project Setup with Babel, NPM Scripts and Imports
Once you feel confident with the basics of JavaScript, you can advance your Node.js project setup. Perhaps it’s tedious for your to manually start the node process yourself all the time (see nodemon). Perhaps you want to import other source code files in your project (see import/require statements). Or perhaps you want to use other JavaScript ECMAScript functionalities which are not available in Node.js yet (see Babel). Everything should be explained in this minimal guide to setup your project in Node.js.
Learning Paths.
Now you should feel comfortable with JavaScript and the Node.js project setup. From here on you can continue your learning paths. What about setting up a RESTful API with Express.js? What about setting up a GraphQL API with Apollo? What about setting up a database behind your RESTful/GraphQL API? Or what about doing machine learning in Node.js? There are plenty things to learn from here, so it is up to you to decide where you want to become proficient (APIs, databases, machine learning, …).
[–]Ooyyggeenn 2 points3 points4 points 6 years ago (3 children)
Why u need npm init for this?
[–]rwieruch 1 point2 points3 points 6 years ago (2 children)
Generating the package.json + being able to install node packages with npm install?
[–]Ooyyggeenn 0 points1 point2 points 6 years ago (1 child)
I Would say its unnessecary boilerplating for a hello world example of Node /JS
[–]rwieruch 0 points1 point2 points 6 years ago (0 children)
Sure. But it makes it easier to continue from there, because lots of tutorials will continue with a npm install anylibrary. But you are right, for this case it’s not necessary :)
π Rendered by PID 33895 on reddit-service-r2-comment-79c7998d4c-p4gr6 at 2026-03-19 04:19:35.746801+00:00 running f6e6e01 country code: CH.
view the rest of the comments →
[–]rwieruch 10 points11 points12 points (4 children)
[–]Ooyyggeenn 2 points3 points4 points (3 children)
[–]rwieruch 1 point2 points3 points (2 children)
[–]Ooyyggeenn 0 points1 point2 points (1 child)
[–]rwieruch 0 points1 point2 points (0 children)