From 98d96eaf262b1ed5099a22ea8ab7bb64e4a67e6d Mon Sep 17 00:00:00 2001 From: Antonio Viggiano Date: Wed, 21 Mar 2018 01:00:12 -0300 Subject: [PATCH] Remove unused files --- package.json | 9 +-------- src/table.js | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 src/table.js diff --git a/package.json b/package.json index 08e7291d..d52c02e1 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,7 @@ "svgstore": "npm run svgstore:black && npm run svgstore:color && npm run svgstore:icon && npm run svgstore:white", "clean": "rimraf build && rimraf dist", "build": "npm run minify-images && npm run imacss && npm run svgstore", - "prebuild": "npm run clean", - "table": "node src/table.js" + "prebuild": "npm run clean" }, "repository": { "type": "git", @@ -76,13 +75,7 @@ "concat": "^1.0.3", "imacss": "^1.0.0", "imagemin-cli": "^3.0.0", - "lodash": "^4.17.5", - "markdown-table": "^1.1.1", "mkdirp": "^0.5.1", - "node-dir": "^0.1.17", - "path": "^0.12.7", - "recursive-readdir": "^2.2.2", - "request": "^2.85.0", "rimraf": "^2.6.2", "svgstore-cli": "^1.3.1" } diff --git a/src/table.js b/src/table.js deleted file mode 100644 index 8468b532..00000000 --- a/src/table.js +++ /dev/null @@ -1,42 +0,0 @@ -const fs = require('fs') -const _ = require('lodash') -const async = require('async') -const path = require('path') -const request = require('request') -const recursive = require('recursive-readdir') -const markdownTable = require('markdown-table') - -const url = 'https://api.coinmarketcap.com/v1/ticker/?limit=0' - -async.autoInject({ - files: (cb) => recursive(path.join(__dirname, '../svg/'), cb), - crypto: (cb) => request(url, (err, res, body) => cb(err, body)), - table: (files, crypto, cb) => { - const coins = JSON.parse(crypto) - const headers = {} - const table = _.chain(files) - .map(file => { - const pathArray = file.split(path.sep) - const folder = pathArray[pathArray.length - 2] - headers[folder] = true - const fileName = path.basename(file, '.svg') - const coin = coins.find(coin => coin.symbol.toLowerCase() === fileName) - return { - symbol: fileName, - name: coin ? coin.name : '?', - [folder]: 'yes' - } - }) - .groupBy(e => e.symbol) - .reduce((a, b) => [...a, b.reduce((m, n) => Object.assign({}, m, n))], []) - .value() - const header = ['symbol', 'name', ...Object.keys(headers)] - const tableOfArrays = table.map((coin) => header.map(h => coin[h])) - const markdown = markdownTable([header, ...tableOfArrays]) - - const readmePath = path.join(__dirname, '../README.md') - const readme = fs.readFileSync(readmePath, 'utf-8') - const updatedReadme = readme.replace(/[^\0]*?/, `\n${markdown}\n`) - fs.writeFile(readmePath, updatedReadme, cb) - } -}) \ No newline at end of file