node package manager
We need your input. Help make JavaScript better: Take the 2017 JavaScript Ecosystem survey »


npm mit license build status coverage status deps status

Sane CLI user-input (command prompt, confirm, multiline, password) as promises, it can be used with co@4


npm i --save prompt-promise

Run examples

npm run with-co
npm run without-co


For more use-cases see examples

var co = require('co');
var prompt = require('prompt-promise');
var res = [];
prompt('username: ')
.then(function username(val) {
  return prompt.password('password: ');
.then(function pasword(val) {
.catch(function rejected(err) {
  console.log('error:', err.stack);
// or with `co@4` 
co(function * genPrompt() {
  var username = yield prompt('username: ');
  var password = yield prompt.password('password: ');
  return yield [username, password];
.then(function fulfilled(array) {
  console.log('response:', array);
.catch(function rejected(err) {
  console.log('error:', err.stack);

.end(), .done(), .finish() are just aliases for process.stdin.pause(); its required, nah..


Charlike Mike Reagent

License MIT license

Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
Copyright (c) 2014 TJ Holowaychuk, contributors.
Released under the MIT license.

Powered and automated by kdf, January 31, 2015