How to use prompt

Comprehensive prompt code examples:

How to use prompt.stop:

33
34
35
36
37
38
39
40
41
42

  return reject(err);

}

prompt.stop();

resolve({
  'email': encode(result.email),
  'pass': encode(result.password)

How to use prompt.history:

428
429
430
431
432
433
434
435
436
437
default: tmpdflt,
ask: function () {
  if (prompt.history(parentToken) === null) {
    return false
  }
  // const name = prompt.history(parentToken).value
  return prompt.history(parentToken).value === 'yes'
},
conform: function (filename) {
  if (fs.existsSync(filename)) {

How to use prompt.start:

12
13
14
15
16
17
18
19
20
21
22
//     --amounts send_funds_amounts_example.csv \
//     --out ./sent_txns.csv \
//     --network wss://nodes.testnet.fractalprotocol.com \
//     --send-at-once 256
async function main() {
  await prompt.start({ stdout: process.stderr });


  const outFile = args["out"] ?? "./sent_txns.csv";
  const amounts = parseAmounts(args.amounts, outFile, {
    allowDuplicates: args["allow-duplicates"] ?? false,

How to use prompt.get:

95
96
97
98
99
100
101
102
103
104
105
  return amounts;
}


async function getSigner() {
  const keyring = new Keyring({ type: "sr25519" });
  const { privateKey } = await prompt.get({
    properties: {
      privateKey: {
        hidden: true,
      },