New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

btcaverage

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

btcaverage - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

12

btcaverage.js

@@ -7,2 +7,6 @@ var Q = require('q');

var TIMEOUT = 5000;
var ACCEPTABLE_VARIANCE = 3;
var MINIMUM_VALUES_VARIANCE = 3;
/**

@@ -16,3 +20,7 @@ * GET PRICE FROM API SERVICE

function requestPrice(urlAPI, objectPath, callback){
request.get(urlAPI, function(error, res, body){
request({
method: 'GET',
url: urlAPI,
timeout: TIMEOUT
}, function(error, res, body){

@@ -64,3 +72,3 @@ if(error){

function(err, prices){
var infoAverage = smartaverage(3, 3, prices);
var infoAverage = smartaverage(ACCEPTABLE_VARIANCE, MINIMUM_VALUES_VARIANCE, prices);
var pricesProviders = {};

@@ -67,0 +75,0 @@ prices.forEach(function(price, i){

2

package.json
{
"name": "btcaverage",
"description": "Get Bitcoin price average from 13 providers. Doing math variance algorithm: if some service is broken the average not will be broken.",
"version": "0.0.3",
"version": "0.0.4",
"author": "CodersBrothers",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/CodersBrothers/btcaverage",

# Bitcoin price average
This library uses multiple providers of price for calculate average price in $ (USD), but with one important feature: If some service is broken the average not will be broken. Use a math concept: Variance. This use prices calculating variance and discarding the farthest values. This library is resistant for errors in providers.
This library uses multiple providers of price for calculate price average in $ (USD), but with one important feature: If some service is broken the average not will be broken. Use a math concept: Variance. BtcAverage uses providers prices calculating variance and discarding the farthest values. This library is resistant for errors of the providers.

@@ -28,3 +28,3 @@ ## Providers

```js
var btcaverage = require('./btcaverage');
var btcaverage = require('btcaverage');
btcaverage()

@@ -31,0 +31,0 @@ .then(function(priceDetails){

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc