Programming Tips - Nodejs: hello world

Date: 2020mar22 OS: Linux Language: javaScript Alternate-title: Run javaScript on the command line Q. Nodejs: hello world A. To run your first command-line nodejs script
dnf install nodejs cd ~ mkdir myhello
Make file called myhello.js containing:
#!/usr/bin/env node 'use strict'; console.log('Hello World!');
Make it executable:
chmod a+x myhello.js
Run it:
./myhello.js