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

bitcoin-stat

v1.0.1

Published

A small library that gives current Bitcoin statistics from Coindesk.

Downloads

5

Readme

Bitcoin Stat

About

Bitcoin Stat is a library that gives current statistics about bitcoin through my backend api that I made that recieves data from Coindesk, so essentially, this library is an api wrapper of my api that I made. All of the data comes completely from Coindesk and can be found here (https://www.coindesk.com/price/bitcoin).

Usage

First and foremost, install Bitcoin Stat using npm like so

$ npm i bitcoin-stat

Then, once you have done that, require it in your code

const bitcoin = require('bitcoin-stat')

The bitcoin constant will give you an object with (current) information on the following...

const bitcoin = require('bitcoin-stat')

console.log(bitcoin)
//output shoule be something similar to this
/*
{
  price: '$43,265.21',
  '24h_change': '6.99',
  market_cap: '$812.40B',
  '24h_volume': '$40.86B',
  '24h_low': '$39,907.58',
  '24h_high': '$43,386.79',
  net_change: '$2,828.62',
  '24h_open': '$40,439.68',
  all_time_high: '$64,829.14',
  total_supply: '18.78M',
  '24h_returns': '6.99',
  ytd_returns: '48.82',
  '30d_volatility': '0.63',
  '24h_transaction_count': '249,454',
  '24h_average_transaction_fee': '$2.48',
  '24h_value_transacted': '$9.34B'
}
*/

console.log(bitcoin.price) //output - $43,265.21
console.log(bitcoin['24h_change']) //output - 6.99
console.log(bitcoin.market_cap) //output - $812.40B
console.log(bitcoin['24h_volume']) //output - $40.86B
console.log(bitcoin['24h_low']) //output - $39,907.58
console.log(bitcoin['24h_high']) //output - $43,386.79
console.log(bitcoin.net_change) //output - $2,828.62
console.log(bitcoin['24h_open']) //output - $40,439.68
console.log(bitcoin.all_time_high) //output - $64,829.14
console.log(bitcoin.total_supply) //output - 18.78M
console.log(bitcoin['24h_returns']) //output - 6.99
console.log(bitcoin.ytd_returns) //output - 48.82
console.log(bitcoin['30d_volatility']) //output - 0.63
console.log(bitcoin['24h_transaction_count']) //output - 249,454
console.log(bitcoin['24h_average_transaction_fee']) //output - $2.48
console.log(bitcoin['24h_value_transacted']) //output - $9.34B