Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 387 Bytes

section1.2.md

File metadata and controls

18 lines (13 loc) · 387 Bytes

Section 1.2: Hello World command line

let username = process.argv[2];

if (!username) {
  // Extract the filename
  let appName = process.argv[1].split(require('path').sep).pop();
  console.error('Missing argument! Example: %s YOUR_NAME', appName);

  // An error will stop the
  process.exit(1);


}
// Print the message to the console.
console.log('Hello %s!', username);