CH. 6 Using JavaScript: the big picture Flashcards
two platforms where JavaScript can be used:
- Web browser
- Node.js
Node.js is important for web development in three ways:
- You can use it to write server-side software in JavaScript.
- You can also use it to write software for the command line; (think Unix shell, Windows PowerShell, etc.) As many JavaScript-related tools are based on (and executed via) Node.js.
- Node’s software registry, npm, has become the dominant way of installing tools (such as compilers and build tools) and libraries; – even for client-side development
The structure of the two JavaScript platforms web browser and Node.js. are similar with…
The APIs “standard library” and “platform API” are hosted on top of a foundational layer with a JavaScript engine and a platform-specific “core”.
The foundational layer consists of?
The JavaScript engine and platform-specific “core” functionality
Two APIs are hosted on top of this foundation:
– The JavaScript standard library is part of JavaScript proper and runs on top of the engine.
– The platform API are also available from JavaScript – it provides access to platform-specific functionality.
Platform API - In browsers, you need to use the platform-specific API if you want to do anything related to the user interface:
to react to mouse clicks, play sounds,
etc.
Platform API in Node.js, the platform-specific API lets you…
read and write files, download data via HTTP, etc.