How to use the promptly.password function in promptly

To help you get started, we’ve selected a few promptly 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 rutkai / Mjolnir-Authentication-Server / cli.js View on Github external
function createHash() {
    var algorithm = config.get('hashAlgorithm');
    var passwordValidator = function (value) {
        if (!value) {
            throw new Error('Password cannot be empty!');
        }

        return value;
    };

    console.log('Hashing algorithm: ', algorithm);
    promptly.password('Password: ', { validator: passwordValidator }, function (err, password) {
        console.log('Password hash: ', crypto.createHash(algorithm).update(password).digest("hex"));
    });
}
github kube-js / kube-ts-server / src / presenter / commander / functions / dbSeed / functions / createUser / index.ts View on Github external
const createUser = (config: FactoryConfig) => async ({
  defaultEmail,
  defaultPassword,
  rolesIds,
  userType,
}: Options) => {
  console.log(`--------------------------------------------------------`);
  console.log(`Creating ${userType}...`);

  const email = await promptly.prompt(
    `Choose email [default: ${defaultEmail}]: `,
    { default: defaultEmail }
  );
  const password = await promptly.password(
    `Choose password [default: ${defaultPassword}]: `,
    { default: defaultPassword }
  );

  const { service } = config;

  console.log('Validating input...');
  validateData(rules)({ email, password });
  console.log('Input validated successfuly!');

  console.log(`Creating ${userType}...`);

  const userId = uuid();

  const { item: user } = await service.users.createItem({
    id: userId,
github leancloud / avoscloud-code-command / bin / run.js View on Github external
function input(info, cb, password) {
    var pcb = function(err, anwser) {
        cb(anwser);
    };
    if (password) {
        promptly.password(info, pcb);
    } else {
        promptly.prompt(info, pcb);
    }
}
    /**
github hydrotik / node-hapi-react-redux-sass-typescript-mongo-webpack-hmr-gulp / setup.js View on Github external
smtpPassword: ['smtpUsername', function (done, results) {

        Promptly.password('SMTP password:', done);
    }],
    createConfig: ['smtpPassword', function (done, results) {
github Bannerets / tdl / src / prompt.js View on Github external
export const getPassword = (passwordHint: string, retry?: boolean): Promise =>
  promptly.password(retry
    ? 'Wrong password, please re-enter: '
    : `Please enter password (${passwordHint}): `,
  { replace: '*' })
github alexbosworth / ln-service / service / wallet_password_prompt.js View on Github external
module.exports = async ({}) => {
  return await promptly.password(walletPasswordPrompt, {replace: mask});
};
github jedireza / aqua / first-time-setup.js View on Github external
rootPassword: ['rootEmail', (results, done) => {

        Promptly.password('Root user password:', done);
    }],
    setupRootUser: ['rootPassword', (results, done) => {

promptly

Simple command line prompting utility

MIT
Latest version published 4 years ago

Package Health Score

74 / 100
Full package analysis