
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
prompt-promise
Advanced tools
Sane CLI user-input (command prompt, confirm, multiline, password) as promises, it can be used with co@4
Sane CLI user-input (command prompt, confirm, multiline, password) as promises, it can be used with co@4
npm i --save prompt-promise
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) {
res.push(val);
return prompt.password('password: ');
})
.then(function pasword(val) {
res.push(val);
console.log(res);
prompt.done();
})
.catch(function rejected(err) {
console.log('error:', err.stack);
prompt.finish();
});
// 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);
prompt.end();
})
.catch(function rejected(err) {
console.log('error:', err.stack);
process.stdin.pause();
});
.end()
, .done()
, .finish()
are just aliases for process.stdin.pause();
its required, nah..
Charlike Mike Reagent
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
FAQs
Sane CLI user-input (command prompt, confirm, multiline, password) as promises, it can be used with co@4
The npm package prompt-promise receives a total of 4,861 weekly downloads. As such, prompt-promise popularity was classified as popular.
We found that prompt-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.