Skip to content

Instantly share code, notes, and snippets.

View kevireilly's full-sized avatar

Kevin Reilly kevireilly

  • California, USA
View GitHub Profile
@joepie91
joepie91 / getting-started.md
Last active February 21, 2024 14:45
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. _Get out there and build things!

"use strict";
var cluster = require("cluster");
if (process.env.NODE_ENV == 'production' && cluster.isMaster) {
// this is the master control process
console.log("Control process running: PID=" + process.pid);
// fork as many times as we have CPUs
var numCPUs = process.env.NPROCS || require("os").cpus().length;