API for interacting with price of bitcoin/altcoins from cryptowa.ch.
$ npm install --save cryptowatch
To get the price from coinbase for BTC in USD.
import Cryptowatch from 'cryptowatch'
const cw = new Cryptowatch()
cw.price('btc', 'usd', 'coinbase')
.then(p => console.log(p.price))
.catch(err => console.log(err))
Alternatively, in ES5
var cryptowatch = require('cryptowatch')
cw = new cryptowatch()
cw.price('btc', 'usd', 'coinbase')
.then(function(p) {
console.log(p.price)
})