How to use password-prompt - 1 common examples

To help you get started, we’ve selected a few password-prompt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scastiel / protonmail-export / src / main.js View on Github external
async function decryptPrivateKey(privateKey: openpgp.key): Promise {
    let ok = false;
    let firstTry = true;
    do {
        if (!firstTry) {
            console.log('Wrong passphrase.');
        const passphrase = await prompt('Private key passphrase: ', { method: 'hide' });
        ok = privateKey.decrypt(passphrase);
        firstTry = false;
    } while (!ok);


cross-platform masked or hidden prompt

Latest version published 4 years ago

Package Health Score

65 / 100
Full package analysis

Popular password-prompt functions