Socket
Socket
Sign inDemoInstall

nftwang

Package Overview
Dependencies
60
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nftwang

check btc price


Version published
Maintainers
1
Created

Readme

Source
# BTC Price Checker

[![npm version](https://img.shields.io/npm/v/btc-price-checker.svg?style=flat-square)](https://www.npmjs.com/package/btc-price-checker)

A simple package to retrieve the current price of Bitcoin (BTC).

## Installation

Install the package using npm:

npm install btc-price-checker


## Usage

To use the package, you need to import it:

```javascript
const btcPriceChecker = require('btc-price-checker');

Then, you can call the getBTCPrice() function to retrieve the current price of Bitcoin:

btcPriceChecker.getBTCPrice()
  .then(price => {
    console.log(`The current price of Bitcoin is $${price}`);
  })
  .catch(error => {
    console.error('Error fetching BTC price:', error);
  });

API Documentation

The package provides the following function:

getBTCPrice()

This function fetches the current price of Bitcoin from a reliable data source. It returns a Promise that resolves to the current price in USD.

Examples

Here's an example of how to use the getBTCPrice() function:

const btcPriceChecker = require('btc-price-checker');

btcPriceChecker.getBTCPrice()
  .then(price => {
    console.log(`The current price of Bitcoin is $${price}`);
  })
  .catch(error => {
    console.error('Error fetching BTC price:', error);
  });

Contributing

If you wish to contribute to this package, you can follow the guidelines in CONTRIBUTING.md file.

License

This package is licensed under the MIT License.

FAQs

Last updated on 01 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc