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

yahoo-exchange

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yahoo-exchange - npm Package Compare versions

Comparing version 1.5.1 to 1.5.2

8

index.js

@@ -38,3 +38,3 @@ "use strict";

}, (err, response, html) => {
let h = html.toString().split(`data-reactid=\"43\">`)[2];
let h = html.toString().split(`data-reactid=\"75\"`)[2];
if (err)

@@ -44,3 +44,3 @@ reject(err);

const pair = h.match(/>(...\/...)/gmi);
const price = h.match(/">([0-9,.])+/gmi);
const price = h.match(/">([0-9,.]+)/gmi);
const changes = h.match(/ -->[^0-9reactspa/><\-]*[0-9.\-]+/gmi);

@@ -57,3 +57,3 @@ resolve(arrayLen24.map((v, a) => [remove(pair[a], '>'), parseFloat(remove(price[a], '\">')), parseFloat(remove(changes[a * 2], " -->")), parseFloat(remove(changes[a * 2 + 1], ' -->'))]));

}, (err, response, html) => {
let h = html.toString().split(`data-reactid=\"43\">`)[2];
let h = html.toString().split(`data-reactid=\"75\"`)[2];
if (err)

@@ -63,3 +63,3 @@ errorHandler(err);

const pair = h.match(/>(...\/...)/gmi);
const price = h.match(/">([0-9,.])+/gmi);
const price = h.match(/">([0-9,.]+)/gmi);
const changes = h.match(/ -->[^0-9reactspa/><\-]*[0-9.\-]+/gmi);

@@ -66,0 +66,0 @@ callback(arrayLen24.map((v, a) => [remove(pair[a], '>'), parseFloat(remove(price[a], '\">')), parseFloat(remove(changes[a * 2], " -->")), parseFloat(remove(changes[a * 2 + 1], ' -->'))]));

@@ -29,2 +29,3 @@ import request = require("request");

});
export function getExchangeDataLowTrafficP(): Promise<Array<Array<any>>> {

@@ -35,7 +36,7 @@ return new Promise<Array<Array<any>>>(((resolve, reject) => request({

}, (err, response, html) => {
let h = html.toString().split(`data-reactid=\"43\">`)[2];
let h = html.toString().split(`data-reactid=\"75\"`)[2];
if (err) reject(err);
else {
const pair = h.match(/>(...\/...)/gmi);
const price = h.match(/">([0-9,.])+/gmi);
const price = h.match(/">([0-9,.]+)/gmi);
const changes = h.match(/ -->[^0-9reactspa/><\-]*[0-9.\-]+/gmi);

@@ -46,2 +47,3 @@ resolve(arrayLen24.map((v, a) => [remove(pair[a], '>'), parseFloat(remove(price[a], '\">')), parseFloat(remove(changes[a * 2], " -->")), parseFloat(remove(changes[a * 2 + 1], ' -->'))]));

}
export function getExchangeDataLowTraffic(callback: (data: Array<Array<any>>) => any, errorHandler: (error: Error, pair?: String) => any = err => console.log(err)): void {

@@ -52,7 +54,7 @@ request({

}, (err, response, html) => {
let h = html.toString().split(`data-reactid=\"43\">`)[2];
let h = html.toString().split(`data-reactid=\"75\"`)[2];
if (err) errorHandler(err);
else {
const pair = h.match(/>(...\/...)/gmi);
const price = h.match(/">([0-9,.])+/gmi);
const price = h.match(/">([0-9,.]+)/gmi);
const changes = h.match(/ -->[^0-9reactspa/><\-]*[0-9.\-]+/gmi);

@@ -59,0 +61,0 @@ callback(arrayLen24.map((v, a) => [remove(pair[a], '>'), parseFloat(remove(price[a], '\">')), parseFloat(remove(changes[a * 2], " -->")), parseFloat(remove(changes[a * 2 + 1], ' -->'))]));

@@ -14,3 +14,3 @@ {

"main": "index.js",
"version": "1.5.1",
"version": "1.5.2",
"license": "MIT",

@@ -17,0 +17,0 @@ "dependencies": {

@@ -12,10 +12,10 @@ const index = require('../index');

index.getFxYahooJapan(v => console.log(v));
// index.getFxYahooJapan(v => console.log(v));
index.getExchangeDataLowTraffic(v => console.log(v));
index.getExchangeDataLowTrafficP().then(v => console.log(v));
index.getExchangeDataArray('USDKRW', data => console.log(data));
index.getExchangeDataArray(['USDKRW', 'JPYKRW'], data => console.log(data));
index.getExchangeDataArray('USDKRW', (data, pair) => console.log(data, pair));
index.getExchangeDataArray(['USDKRW', 'JPYKRW'], (data, pair) => console.log(data, pair));
index.getExchangeDataArray('USDKRW', (data, pair) => console.log(data, pair), (error, pair) => console.log(`[Error] ${pair}\n${error}`));
index.getExchangeDataArray(['USDKRW', 'JPYKRW'], (data, pair) => console.log(data, pair), (error, pair) => console.log(`[Error] ${pair}\n${error}`));
// index.getExchangeDataLowTrafficP().then(v => console.log(v));
// index.getExchangeDataArray('USDKRW', data => console.log(data));
// index.getExchangeDataArray(['USDKRW', 'JPYKRW'], data => console.log(data));
// index.getExchangeDataArray('USDKRW', (data, pair) => console.log(data, pair));
// index.getExchangeDataArray(['USDKRW', 'JPYKRW'], (data, pair) => console.log(data, pair));
// index.getExchangeDataArray('USDKRW', (data, pair) => console.log(data, pair), (error, pair) => console.log(`[Error] ${pair}\n${error}`));
// index.getExchangeDataArray(['USDKRW', 'JPYKRW'], (data, pair) => console.log(data, pair), (error, pair) => console.log(`[Error] ${pair}\n${error}`));

Sorry, the diff of this file is not supported yet

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