SegmentFault用戶,獨立開發者,前支付寶前端開發工程師郭宇,爲極客們準備的一個命令行工具,方便你們看btc各交易站實時價格:前端
$ [sudo] npm install btc -g
只要運行btc
,實時價格會自動顯示git
$ btc
btc cli爲您提供一些實用的快捷鍵:github
[enter] -> refresh prices as you wish [g] -> go to current exchange market [a] -> autorefresh the current exchange market every 10 seconds, press [a] to cancel or [enter] to cancel all [q] -> quit
var btc = require('btc'); // fetch a prices list btc.price(function(err, prices){ console.log(prices); }); // fetch a seleced exchanger btc.price('btcchina', function(err, prices){ console.log(prices); });
能夠隨時增長你新的比特幣api:npm
$ git clone https://github.com/turingou/btc.git && cd btc $ vi ./libs/exchangers.js
確保每一個API都有其獨特的URL網站
,並填寫參數貨幣
。segmentfault
請查看該文件:index.jsapi
btc支持如下交易平臺及方式:dom
原文是 郭宇 發佈在本身github 項目上的說明文檔
本文由 segmentfault 翻譯工具