From e951e2a3a76629e50b6c907fc0de15b2a45c971e Mon Sep 17 00:00:00 2001 From: Igor Kroitor Date: Wed, 6 Dec 2017 21:41:06 +0300 Subject: [PATCH] updated examples/js/symbols.js --- examples/js/symbols.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/js/symbols.js b/examples/js/symbols.js index 24b3dcf5d696..894f2e78a720 100644 --- a/examples/js/symbols.js +++ b/examples/js/symbols.js @@ -6,6 +6,13 @@ const log = require ('ololog') require ('ansicolor').nice; +//----------------------------------------------------------------------------- + +const verbose = process.argv.includes ('--verbose') +const debug = process.argv.includes ('--debug') + +//----------------------------------------------------------------------------- + let printSupportedExchanges = function () { log ('Supported exchanges:', ccxt.exchanges.join (', ').green) } @@ -25,7 +32,7 @@ let printSymbols = async (id) => { // instantiate the exchange by id let exchange = new ccxt[id] ({ - // 'verbose': true, + verbose, // 'proxy': 'https://cors-anywhere.herokuapp.com/', // 'proxy': 'https://crossorigin.me/', }) @@ -37,7 +44,8 @@ let printSymbols = async (id) => { log (id.green, 'has', exchange.symbols.length, 'symbols:', exchange.symbols.join (', ').yellow) // debug log - Object.values (markets).forEach (market => log (market)) + if (debug) + Object.values (markets).forEach (market => log (market)) // make a table of all markets let table = asTable.configure ({ delimiter: ' | ' }) (ccxt.sortBy (Object.values (markets), 'symbol'))