Guest User

Untitled

a guest
Mar 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. // Imports prompt module into prompt constant variable
  2. const prompt = require('prompt');
  3.  
  4. // Starts the prompt
  5. prompt.start();
  6. // Gets a prompt called 'name'
  7. // and runs a function which takes
  8. // the name property once the prompt is done
  9. prompt.get('name', (err, { name }) => {
  10. // Prints hello and the name to the terminal
  11. console.log(`Hello, ${ name }!`);
  12. });
Add Comment
Please, Sign In to add comment