Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Imports prompt module into prompt constant variable
- const prompt = require('prompt');
- // Starts the prompt
- prompt.start();
- // Gets a prompt called 'name'
- // and runs a function which takes
- // the name property once the prompt is done
- prompt.get('name', (err, { name }) => {
- // Prints hello and the name to the terminal
- console.log(`Hello, ${ name }!`);
- });
Add Comment
Please, Sign In to add comment