input
This file
Path
examples/input
24 lines · 515 bytes
Last changed by
Fixed: line-buffered input automatically trimmed. Closes #31Tj Holowaychukbefore adoption9745551
History of this fileTake it
1#!/usr/bin/env node23/**4 * Module dependencies.5 */67var program = require('../');89program.prompt('Username: ', function(name){10 console.log('hi %s\n', name);1112 program.prompt('Description:', function(desc){13 console.log('description was "%s"', desc.trim());1415 program.prompt('Age: ', Number, function(age){16 console.log('age: %j\n', age);1718 program.prompt('Birthdate: ', Date, function(date){19 console.log('date: %s\n', date);20 process.stdin.destroy();21 });22 });23 });24});