This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
irreligious/node_modules/enquirer/lib/prompts/password.js

19 lines
432 B
JavaScript

'use strict';
const StringPrompt = require('../types/string');
class PasswordPrompt extends StringPrompt {
constructor(options) {
super(options);
this.cursorShow();
}
format(input = this.input) {
if (!this.keypressed) return '';
let color = this.state.submitted ? this.styles.primary : this.styles.muted;
return color(this.symbols.asterisk.repeat(input.length));
}
}
module.exports = PasswordPrompt;