1.0.5 • Published 7 years ago

crypto-coins v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

crypto-coins

CLI/module based package to get crypto currency price. WIP.

Install

    $ npm i -g crypto-coins  //  for CLI

    $ npm i -S crypto-coins  // for package usage

CLI usage

After global installation , command with no argument will give top 10 coins based on market cap.

    $ crypto-coins

Get individual coin detail by passing coin's short name or long name.

    // Argument can be any of  --btc,--bitcoin, --ETH,--litecoin ,etc.

    $ crypto-coins --btc

Module usage

Module has four methods namely getCoinSymbol , getTopCoins ,getCoinHistory , getCoinDetail & are based on coincap.

var cryptoCoins = require('crypto-coins');

//Outputs  [{"name":"Bitcoin","symbol":"BTC"},{"name": "Ethereum","symbol": "ETH"}]

cryptoCoins.getCoinSymbol()
       .then(res=>console.log(res));


// gives top coins based on market cap. Default 100 coins.

cryptoCoins.getTopCoins(noOfCoins)
       .then(res=>console.log(res));

// where  day = 1,7,30,180 , coinName = 'btc','bitcoin' ,etc.

cryptoCoins.getCoinHistory(day, coinName)
       .then(res=>console.log(res));


//  coinName = 'btc','bitcoin' ,'BITCOIN' ,etc.
cryptoCoins.getCoinDetail(coinName)
       .then(res=>console.log(res));