UNPKG

enquirer

Version:

Stylish, intuitive and user-friendly prompt system. Fast and lightweight enough for small projects, powerful and extensible enough for the most advanced use cases.

19 lines (14 loc) 432 B
'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;