I have created a NPM module "cryptoticker" which enables you to easily find the price of a certain cryptocurrency from a lot of website. As of now, I have only added CoinMarketCap, and other websites are for future works.
Crypto Ticker as the name suggests will easily provide the information about the crypto currencies right from the NPM package. Since we have a lot of websites which provide price feed of currencies, I thought of including it all in my package. As per the initial release 1.0.0 I have only included CoinMarketCap. The problem with coinmarket cap is that it only accepts as a short form of the currency i.e. 'btc', 'eth', so I have to actually keep a record o both short form and long form so that whatever name you give. It will give you the result.
One thing to note that I am sending it as a promise so you have to actually catch any exception otherwise it will give "Unhandled Promise Rejection Error".
At first you need to install it using the command npm install cryptoticker --savedev and then run the below code
const crypto = require('cryptoticker');
crypto.price('btc').then(a=>console.log(a));
If you do not want to install, just download the repo and head over to the tests folder and run the getprice.js file using command 'node getprice.js', it will give the output as shown below
I have the same name in github, but I am also providing the Logged in session screenshot.