1.0.8 • Published 5 years ago

stock-crypto-monitor v1.0.8

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

stock-crypto-monitor

Continuously monitors cryptocurrency and stock prices and the total market cap. Currently, the prices are fetched from CoinGecko and Yahoo Finance.

This is a general purpose package, but it is ideal for Termux in Android to continuously show the price of cryptocurrencies in the notification area. See examples/termux.js

NPM NPM Downloads

  • Supports more than 5000 cryptocurrencies
  • Supports all stock tickers on Yahoo Finance
  • Continuously displays the prices and total market cap
  • Accepts callbacks for each time the price is updated

#Installation

npm install stock-crypto-monitor --save

Screenshot

examples/demo.js Output example

Termux (Android)

Termux

Usage

Simple

const stock_crypto_monitor = require("stock-crypto-monitor")({
  cryptosOfInterest: "BTC,ETH,LTC",
  stocksOfInterest: ["AAPL", "GOOGL"]
});
stock_crypto_monitor.start();

Query prices

const crypto_price_checker = require("../index.js")({
  cryptosOfInterest: ["BTC", "ETH", "LTC"],
  stocksOfInterest: ["AAPL", "GOOGL"],
  updateIntervalInSeconds: 10
});

async function start() {
  await crypto_price_checker.start();

  // Prices are now available
  let c = crypto_price_checker.getPrice("AAPL");
  crypto_price_checker.log("AAPL: ", c);
}

start();

Other options

var stock_crypto_monitor = require("stock-crypto-monitor")({
  getCoinGeckoPrices: true,
  getStockPricesFromYahoo: true,
  initialCallback: null, // Function called in the beginning
  updateValuesCallback: null, // Function called at each updated
  cryptosOfInterest: [`BTC`, `ETH`, `LTC`],
  stocksOfInterest: ["AAPL", "GOOGL"],
  updateIntervalInSeconds: 10,
  printIntervalInSeconds: 5,
  printStatus: true,
  updateStatusBar: true
});

Logger

The logger used in this package is available separately in log-with-statusbar npm package