Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 959 Bytes

notes.md

File metadata and controls

50 lines (35 loc) · 959 Bytes

Node.js notes

318. Introducing Node JS

  • Node is an implementation of JavaScript that runs outside of the browser.

319. What is Node used for?

  • What do people build with it?
    • Web servers, CLI tools, native apps, and more

321. The Node REPL

  • Like the browser console
  • No browser specific concepts (ie document, window, DOM API)
node # enter the Node.js REPL
  • Global scope is global, not window. For example:
// browser
window.console.log;

// Node.js
global.console.log;

322. Running Node files

node scripts.js

323. process and argv

process; // object containing information about, and methods for, the current Node.js process
process.argv; // returns an array containing CLI arguments passed when the current process was launched

/*
[
    path of the executable that started the process,
    path of the file being executed,
    any additional CLI arguments
]
*/