My Hive Posts

    Crypto Price Checker NPM Module

    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.

    Introduction

    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".

    How to run it

    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

    image.png

    Proof Of Work

    I have the same name in github, but I am also providing the Logged in session screenshot.

    image.png

    Commits
    1. https://github.com/codingdefined/cryptoticker/commit/08e061eae18d699f03c8fd41c9c723424e8cf281
    2. https://github.com/codingdefined/cryptoticker/commit/1a65e67ce2012c27a41926c623a6070ad82b63fe
    3. https://github.com/codingdefined/cryptoticker/commit/eae3cbf7e0fbe47431e2c36250622f9c3b2ec094
    4. https://github.com/codingdefined/cryptoticker/commit/04a1eb4c95b883078489e604013feb57ba297e7d



    Posted on Utopian.io - Rewarding Open Source Contributors