diff --git a/bin/index.js b/bin/index.js index 01b16b4..42931d3 100755 --- a/bin/index.js +++ b/bin/index.js @@ -172,7 +172,6 @@ program const protocol = params.https ? `https` : 'http' portfinder.basePort = 8080 portfinder.getPortPromise().then(port => { - console.log(`---`, port) exec(`npx http-server --port ${port} ${params.https ? '--ssl' : ''}`, error => { if (error) return print(`error`, `✘ Opps, Something Error: ${error}`) }) diff --git a/helper/index.js b/helper/index.js index 6f3a4b2..b7d3072 100644 --- a/helper/index.js +++ b/helper/index.js @@ -2,7 +2,6 @@ const fs = require('fs') const os = require('os') const path = require('path') const chalk = require('chalk') -const qrcode = require('qrcode') const clear = require('./clear') const print = require('./print') @@ -120,9 +119,7 @@ const showServerAdress = (port, protocol) => { const hostname = chalk.magenta(`${protocol}://${os.hostname}:${port}`) const ipAdress = chalk.magenta(`${protocol}://${getIp()}:${port}`) const localAdress = chalk.magenta(`${protocol}://127.0.0.1:${port}`) - qrcode.toString(`${protocol}://${getIp()}:${port}`, { type: 'terminal' }, (err, url) => { - console.log(url) - }) + generateQrcode(`${protocol}://${getIp()}:${port}`) console.log(`\nListening on:\n✓ ${hostname} \n✓ ${ipAdress} \n✓ ${localAdress}`) } diff --git a/helper/qrcode.js b/helper/qrcode.js index bfb218d..6ab92bc 100644 --- a/helper/qrcode.js +++ b/helper/qrcode.js @@ -20,9 +20,9 @@ const saveQrcode2Loval = (string, commands) => { } module.exports = (string, commands) => { - qrcode.toString(string, { type: 'terminal' }, function(err, url) { + qrcode.toString(string, { type: 'terminal', small: true, width: 200}, (err, url) => { if (err) return print('error', `✘ ${err}`) console.log(url) }) - if (commands.save) saveQrcode2Loval(string, commands) + if (commands && commands.save) saveQrcode2Loval(string, commands) } diff --git a/package.json b/package.json index 1e3d86e..1a5045d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "arya-jarvis", - "version": "1.12.0", + "version": "1.12.1", "description": "Arya Jarvis: Designed to save developers more time and energy.", "main": "bin/index.js", "bin": {