How to use qrcode-terminal - 10 common examples

To help you get started, we’ve selected a few qrcode-terminal 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 wechaty / wechaty-getting-started / examples / simplest-bot / bot.js View on Github external
bot.on('scan', (qrcode, status) => {
  qrTerm.generate(qrcode, { small: true })  // show qrcode on console

  const qrcodeImageUrl = [
    'https://api.qrserver.com/v1/create-qr-code/?data=',
    encodeURIComponent(qrcode),
    '&size=220x220&margin=20',
  ].join('')

  console.log(qrcodeImageUrl)
})
github alibaba / rax / templates / template-chat / webpack.config.js View on Github external
entry['index.bundle.min'] = [paths.appIndexJs];
} else {
  entry['index.bundle'] = [paths.appIndexJs];
}

if (!isProducation) {
  var ip = internalIp.v4();
  var port = 8080;
  var webUrl = 'http://' + ip + ':' + port;
  var bundleUrl = 'http://' + ip + ':' + port + '/js/index.bundle.js';
  var weexBundleUrl = bundleUrl + '?_wx_tpl=' + bundleUrl;

  qrcode.generate(webUrl, {small: true});
  console.log('Web: scan above QRCode ' + webUrl + ' or direct open in browser.\n');

  qrcode.generate(weexBundleUrl, {small: true});
  console.log('Weex: scan above QRCode ' + weexBundleUrl + ' use weex playground.\n');
}

module.exports = {
  // Compile target should "web" when use hot reload
  target: isProducation ? 'node' : 'web',

  // devtool: 'inline-source-map',

  // These are the "entry points" to our application.
  // This means they will be the "root" imports that are included in JS bundle.
  // The first two entry points enable "hot" CSS and auto-refreshes for JS.
  entry: entry,

  output: {
    // Next line is not used in dev but WebpackDevServer crashes without it:
github OAuth3 / oauth3-cli / bin / cli.js View on Github external
// TODO minimal option to exclude these defaults
  url = url
    .replace(/issuer=([^&]*)&?/, '')
    .replace(/digits=6&?/, '')
    .replace(/algorithm=SHA1&?/, '')
    .replace(/period=30&?/, '')
    .replace(/(&|\?)$/, '')
    ;
  state.state = 'qr';
  state.msgs = [
    "Create a New Account" + (state.totpRetry && (" (Take #" + (state.totpRetry + 1) + ")") || '')
  , ""
  ];

  qrcode.setErrorLevel('L'); // L: 7%, M: 15%, Q: 25%, H: 30%
  qrcode.generate(url, function (qr) {
    state.qr = qr;
    state.msgs.push('__RAW__');
  });

  state.msgs.push('');
  state.msgs.push("Download the Authy App at https://www.authy.com/app/");
  state.msgs.push('');
  state.msgs.push(url);
  state.msgs.push('');
  state.msgs.push("Type the 6-digit token below:");

  state.error = null;
  state.prompt = '6-digit Token: ';

  // TODO handle token as 000000 with delimeters '-', ' ', or '.'
  handleInput(ws, state, function (err, token) {
github OAuth3 / oauth3-cli / bin / cli.js View on Github external
);
  // TODO minimal option to exclude these defaults
  url = url
    .replace(/issuer=([^&]*)&?/, '')
    .replace(/digits=6&?/, '')
    .replace(/algorithm=SHA1&?/, '')
    .replace(/period=30&?/, '')
    .replace(/(&|\?)$/, '')
    ;
  state.state = 'qr';
  state.msgs = [
    "Create a New Account" + (state.totpRetry && (" (Take #" + (state.totpRetry + 1) + ")") || '')
  , ""
  ];

  qrcode.setErrorLevel('L'); // L: 7%, M: 15%, Q: 25%, H: 30%
  qrcode.generate(url, function (qr) {
    state.qr = qr;
    state.msgs.push('__RAW__');
  });

  state.msgs.push('');
  state.msgs.push("Download the Authy App at https://www.authy.com/app/");
  state.msgs.push('');
  state.msgs.push(url);
  state.msgs.push('');
  state.msgs.push("Type the 6-digit token below:");

  state.error = null;
  state.prompt = '6-digit Token: ';

  // TODO handle token as 000000 with delimeters '-', ' ', or '.'
github OAuth3 / oauth3-cli / lib / cli.js View on Github external
// TODO minimal option to exclude these defaults
  url = url
    .replace(/issuer=([^&]*)&?/, '')
    .replace(/digits=6&?/, '')
    .replace(/algorithm=SHA1&?/, '')
    .replace(/period=30&?/, '')
    .replace(/(&|\?)$/, '')
    ;
  state.state = 'qr';
  state.msgs = [
    (state.totpRetry && ("[Take #" + (state.totpRetry + 1) + "] ") || '')
  + "Create New Account: Add Multi-Factor Authentication (2FA/MF1)"
  , ""
  ];

  qrcode.setErrorLevel('L'); // L: 7%, M: 15%, Q: 25%, H: 30%
  qrcode.generate(url, function (qr) {
    state.qr = qr;
    state.msgs.push('__RAW__');
  });

  state.msgs.push(url);
  state.msgs.push("");
  state.msgs.push("Download the Authy App at https://www.authy.com/app/");

  FNS.reCompute(ws, state);

  return PromiseA.resolve();
};
github realitio / realitio-dapp / cli / rc_common.js View on Github external
exports.output = function(tx) {
    console.log('0x' + tx.toString('hex'));
    qr.generate(tx.toString('hex'), {small: true});
}
github Codeception / CodeceptJS / lib / helper / TestCafe.js View on Github external
async _startRemoteBrowser(runner) {
    const remoteConnection = await this.testcafe.createBrowserConnection();
    console.log('Connect your device to the following URL or scan QR Code: ', remoteConnection.url);
    qrcode.generate(remoteConnection.url);
    remoteConnection.once('ready', () => {
      runner
        .src(this.dummyTestcafeFile)
        .browsers(remoteConnection)
        .reporter('minimal')
        .run({
          selectorTimeout: this.options.waitForTimeout,
          skipJsErrors: true,
          skipUncaughtErrors: true,
        })
        .catch((err) => {
          this.debugSection('_before', `Error ${err.toString()}`);
          this.isRunning = false;
          this.testcafe.close();
        });
    });
github wechaty / wechaty / examples / contact-bot.ts View on Github external
.on('scan', (qrcode, status) => {
  QrcodeTerminal.generate(qrcode)
  console.log(`${qrcode}\n[${status}] Scan QR Code in above url to login: `)
})
github vlasn / qrip / src / index.js View on Github external
* \`qrip 4000\` to simply generate a QR code with your local network address + the specified port (400 in this case)
    * \`qrip 4000 /landing/hi\` to do the above and append \`/landing/hi\` to the URL.

All other options you pass in will be lost in time, like tears in rain.
    `)
} else {
    const [port, path = ''] = args
    const interfaces = os.networkInterfaces()
    const [{address: ip}] = Object.keys(interfaces)
        .reduce((a, v) => [...a, ...interfaces[v]], [])
        .filter(i => i.internal === false && i.family === 'IPv4')
    const url = `http://${ip}:${port + path}`
    console.log(`generating QR code for ${url} \n`)

    Q.generate(url)
}
github BroNils / LINE-FreshBot / index.js View on Github external
getQrLink((qrcodeUrl, verifier) => {
                console.info('> Please login to your LINE account');
                console.info('> Your qrLink: ' + qrcodeUrl);
                qrcode.generate(qrcodeUrl, {
                    small: true
                });
                qrLogin(verifier, (res) => {
                    console.info('> AuthToken: ' + res.authToken);
                    console.info('> Login Success');
                    options.path = config.LINE_POLL_URL;
                    setTHttpClient(options);
                    callback(res);
                })
            })
            break;

qrcode-terminal

QRCodes, in the terminal

Apache-2.0
Latest version published 6 years ago

Package Health Score

71 / 100
Full package analysis