Socket
Socket
Sign inDemoInstall

cli-ux

Package Overview
Dependencies
Maintainers
7
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-ux - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

25

lib/prompt.js

@@ -55,9 +55,5 @@ "use strict";

function _prompt(name, inputOptions = {}) {
let prompt = '> ';
if (name && inputOptions.default)
prompt = name + ' ' + chalk_1.default.yellow('[' + inputOptions.default + ']') + ': ';
else if (name)
prompt = `${name}: `;
const prompt = getPrompt(name, inputOptions.type, inputOptions.default);
const options = Object.assign({ isTTY: !!(process.env.TERM !== 'dumb' && process.stdin.isTTY), name,
prompt, type: 'normal', required: true }, inputOptions);
prompt, type: 'normal', required: true, default: '' }, inputOptions);
switch (options.type) {

@@ -70,3 +66,7 @@ case 'normal':

case 'hide':
return deps_1.default.passwordPrompt(options.prompt, { method: options.type });
return deps_1.default.passwordPrompt(options.prompt, {
method: options.type,
required: options.required,
default: options.default
});
default:

@@ -114,1 +114,12 @@ throw new Error(`unexpected type ${options.type}`);

}
function getPrompt(name, type, defaultValue) {
let prompt = '> ';
if (defaultValue && (type && type === 'mask' || type === 'hide')) {
defaultValue = '*'.repeat(defaultValue.length);
}
if (name && defaultValue)
prompt = name + ' ' + chalk_1.default.yellow('[' + defaultValue + ']') + ': ';
else if (name)
prompt = `${name}: `;
return prompt;
}
{
"name": "cli-ux",
"description": "cli IO utilities",
"version": "5.1.0",
"version": "5.2.0",
"author": "Jeff Dickey @jdxcode",

@@ -24,3 +24,3 @@ "bugs": "https://github.com/oclif/cli-ux/issues",

"natural-orderby": "^1.0.2",
"password-prompt": "^1.0.7",
"password-prompt": "^1.1.0",
"semver": "^5.6.0",

@@ -27,0 +27,0 @@ "string-width": "^2.1.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc