JavaScript in the Command Line
When using JavaScript in the backend it’s executed from
the command line in a terminal window using the node command.
NodeJS is a JavaScript runtime built on the Chrome Web Browsers JavaScript engine - V8. See the illustration below how NodeJS is different from running JavaScript in the browser.

Third party packages and dependencies can be installed using npm - Node Package Manager from npmjs.org. Installed packages can be referenced in a NodeJS program using the require command (CommonJS) . You can also create your own modules.