From 1b9caedbb09bd25c58ada30c776e96286aab3c3d Mon Sep 17 00:00:00 2001 From: Michael Wuergler Date: Thu, 11 Jan 2018 01:10:21 +0100 Subject: [PATCH] linting OCD --- build.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.js b/build.js index 45b4830..27d7367 100644 --- a/build.js +++ b/build.js @@ -2,10 +2,11 @@ const fs = require('fs'); const fetch = require('isomorphic-fetch'); const sortby = require('lodash.sortby'); const request = require('sync-request'); -const endpoint = 'https://www.cryptocompare.com/api/data/coinlist/'; const ora = require('ora'); const chalk = require('chalk'); +const endpoint = 'https://www.cryptocompare.com/api/data/coinlist/'; + const spinner = ora('Building currencies').start(); spinner.color = 'magenta'; @@ -21,7 +22,7 @@ fetch(endpoint) * Build the JSON file based on the cryptocompare coinlist. */ sorted.forEach((currency, index) => { - const { Name, CoinName, ImageUrl } = currency; + const {Name, CoinName, ImageUrl} = currency; symbols[Name] = CoinName; // download the image for future use @@ -30,15 +31,15 @@ fetch(endpoint) spinner.render(); const res = request('get', `https://www.cryptocompare.com${ImageUrl}`); fs.writeFileSync(`images/${Name}.${ImageUrl.split('.').pop()}`, res.getBody()); - imagesSaved = imagesSaved + 1; + imagesSaved += 1; } }); spinner.succeed([`${imagesSaved} images saved to /images`]); - + spinner.color = 'yellow'; spinner.start(`Saving cryptocurrencies.json file`); - + fs.writeFileSync('cryptocurrencies.json', JSON.stringify(symbols, null, 2)); spinner.succeed(`${sorted.length} currencies saved to cryptocurrencies.json`); @@ -70,6 +71,5 @@ fetch(endpoint) spinner.succeed(['Readme Markdown Table updated']); console.log('\n', 'Remember to', chalk.yellow('git commit'), 'and', chalk.yellow('npm publish')); - }) .catch(err => console.error(err));