# Price Checker
[](https://www.npmjs.com/package/-price-checker)
A simple package to retrieve the current price of Bitcoin ().
## Installation
Install the package using npm:
npm安装-价格检查器
## Usage
To use the package, you need to import it:
```javascript
const ethPriceChecker = require('-price-checker');
然后,您可以调用 getETHPrice() 函数来检索比特币的当前价格:
ethPriceChecker.getEthPrice()
.then(price => {
console.log(`The current price of Bitcoin is $${price}`);
})
.catch(error => {
console.error('Error fetching price:', error);
});
API文档
该软件包提供以下功能:
getEthPrice()
这个函数从一个可靠的数据源获取比特币的当前价格。它返回一个解析为当前美元价格的Promise。
示例
下面是如何使用的一个例子 getEthPrice() 函数:
const ethPriceChecker = require('-price-checker');
ethPriceChecker.getEthPrice()
.then(price => {
console.log(`The current price of is $${price}`);
})
.catch(error => {
console.error('Error fetching price:', error);
});
贡献
如果你想贡献这个包,你可以按照贡献的指导方针。md文件。
许可证
这个包是在MIT许可下授权的。