Reading 6 - Ginsusamurai/seattle-301d58 GitHub Wiki

Reading 6

introduction to nodeJS

  • JS runtime built on Chromes v8 js engine
  • does NOT execute in the browser but rather it's own environment with data file API, HTTP library and system-related methods
  • version manager let's you toggle between multiple node versions
  • good ES6 support and since things are running locally you don't have to worry about compatibility issues
  • use NPM to handle node versions
  • -g for global installation, -y for local
  • nodejs is single-threaded and also event-driven
  • multiple tasks handled as callbacks, each on a listener
  • cons: blocking i/o can cause system shutdown, CPU-intensive tasks should go to a dedicated worker thread, and errors can bring the whole thing down
  • native promises help with callback design structure
  • good for real-time interactior collaboration code (chat sites), can do back-end and front-end in same language, can use JSON, very common language adoption