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);
}

password-prompt

cross-platform masked or hidden prompt

0BSD
Latest version published 8 months ago

Package Health Score

72 / 100
Full package analysis

Popular password-prompt functions