Skip to content

Commit

Permalink
Merge pull request #1 from devil-cyber/master
Browse files Browse the repository at this point in the history
Updating
  • Loading branch information
suubh authored Oct 2, 2020
2 parents 4150589 + fb663f3 commit 01159c7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
20 changes: 15 additions & 5 deletions command/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,34 @@ const check={
try{
key_manager=new keyManager();
const key=key_manager.getKey();
const s="Devloped by:Manikant Kumar";
const l="Github:https://github.com/devil-cyber";
const s="Devloped by:Manikant Kumar | ";
const l="Github:https://github.com/devil-cyber | ";
const email="Email:[email protected]";
const heading = "Crypto-Coin";
//const heading = "Crypto-Coin";
const title = "Welcome to the project!"

const api=new crypto_api(key);
const priceOutputData=await api.getPriceData(cmd.coin,cmd.cur);
console.log("\n\n\n\n\n\n\n");
console.log("\t\t\t\t\t\t\t\t\t\t\t",heading.white)
const chalk = require('chalk');
const clear = require('clear');
const figlet = require('figlet');
const files = require('../lib/files');
clear();
console.log(
chalk.yellow(
figlet.textSync('Crypto-Coin',{horizontalLayout: 'full'})
)
);
//console.log("\t\t\t\t\t\t\t\t\t\t\t",heading.white)
console.log("\t\t\t\t\t\t\t\t\t\t",title.white)
console.log("\n");
console.log("\t\t\t\t\t",s.green,l.yellow,email.red)
console.log("\n");
console.log(priceOutputData);
console.log("\n\n\n\n\n\n\n\n\n\n");
}catch(err){
consol.error(err.message.red);
console.error(err.message.red);
}
}
};
Expand Down
3 changes: 2 additions & 1 deletion lib/crypto_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ class CtyptoApi{
const res=await axios.get(`${this.baseUrl}?key=${this.apiKey}&ids=${coinOption}&convert=${curOption}`);
let output='';
res.data.forEach(coin=>{
output +=` ${coin.rank.green}.[Coin:${coin.symbol.yellow}(${coin.name.yellow}) -- Price:${coin.price.green} -- Rank:${coin.rank.blue}]\n`;
output +=` ${coin.rank.green}.[Coin:${coin.symbol.yellow}(${coin.name.yellow}) --- Price:${coin.price.green} -- Rank:${coin.rank.blue}]\n`;
});

return output;
}catch(err){
console.error(err);
Expand Down
13 changes: 13 additions & 0 deletions lib/files.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const fs = require('fs');
const path = require('path');

module.exports = {
getCurrentDirectoryBase: () => {
return path.basename(process.cwd());
},

directoryExists: (filePath) => {
return fs.existsSync(filePath);
}
};

0 comments on commit 01159c7

Please sign in to comment.