npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

btc-value-cli

v4.0.0

Published

Get the current Bitcoin value CLI

Downloads

34

Readme

Get the current Bitcoin value in command line

Downloads

Installation

npm install --global btc-value-cli

Usage

$ btc-value --help

  Usage
    $ btc-value

  Options
    --key -k                      Set the API key (Obtain key at: https://coinmarketcap.com/api/)
    --decimal -d                  Print value as decimal
    --save -s [code]              Set the currency that will be used by default
    --currency -c [code]          Print the value in another currency
    --list -l                     Print a list of all supported currencies
    --quantity -q [number]        Print the value of the given quantity
    --autorefresh -a [seconds]    Automatic refresh printing every x seconds
    --percentage -p [h|d|w]       Print the percentage change (h = hour, d = day, w = week)
    --reset -r                    Reset the configuration to the default
    --provider [cmc|coingecko]    Set the currency provider to retrieve Bitcoin values from

  Examples
    $ btc-value
    $ btc-value -k <example-API-key>
    $ btc-value -d
    $ btc-value -s NOK
    $ btc-value -c NOK
    $ btc-value -q 2.2
    $ btc-value -p h
    $ btc-value --provider coingecko

Options

--decimal, -d

Print the value as a decimal number.

--save, -s [code]

Set the currency that will be used by default. It will save the new default currency code and symbol in the config.json file. Next time btc-value is run in command line it will print the value of the new default currency.

--currency, -c [code]

Print the value in another currency. It will print out the value of the currency code. A list of all currency codes can be shown with the use of the -l flag.

--list, -l

Print a list of all supported currencies for the selected currency provider.

--quantity, -q [number]

Print the value of the given quantity. Input quantity can be either decimal or integer. If the input quantity is set to a number, the given quantity is saved locally in the config.json file. The -q flag can be used with and without a number input.

--autorefresh, -a [seconds]

Set a timeout that print the value every seconds seconds. The timeout restarts after every use. If seconds is not set, the default timeout is used (15 seconds). This is stored in the config.json file. The reason a timeout is used instead of a interval, is that it might not finish before the next starts (if bad network connection) and this can use more memory than needed.

--percentage, -p [h|d|w]

Print the percentage change the last hour, day and week. If the flag is set to h then percentage change last hour is printed. It is the same for d and days, and w and week. If the percentage is negative it is printed in bright red otherwise it is printed in green.

--reset, -r

Reset the configuration to the default:

{
    default: 'USD',
    quantity: 1,
    autorefresh: 15,
    apiKey: '',
    provider: 'coingecko'
}

--provider [cmc|coingecko]

Set the currency provider to retrieve Bitcoin values from. By default it uses the data from CoinGecko.

--key, -k

Set the API key. This key is optional and only required if using data from the CoinMarketCap API. To obtain an API key go to the Cryptocurrency Market Capitalizations API.

Related