currency-converter-lt
Advanced tools
Comparing version
15
index.js
@@ -214,14 +214,15 @@ const cheerio = require("cheerio") | ||
.then((html) => { | ||
// const fs = require('fs'); | ||
const fs = require('fs'); | ||
// fs.writeFile("a.html", html.body, function(err) { | ||
// if(err) { | ||
// return console.log(err); | ||
// } | ||
// console.log("The file was saved!")}) | ||
fs.writeFile("a.html", html.body, function(err) { | ||
if(err) { | ||
return console.log(err); | ||
} | ||
console.log("The file was saved!")}) | ||
return cheerio.load(html.body)}) | ||
.then(($) => {return $(".iBp4i").text().split(" ")[0]}) | ||
.then((rates) => { | ||
console.log(rates) | ||
if(rates.includes(",")) | ||
rates = rates.replace(",", "") | ||
rates = rates.replaceAll(",", "") | ||
return parseFloat(rates) | ||
@@ -228,0 +229,0 @@ }) |
{ | ||
"name": "currency-converter-lt", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "A nodejs currency converter library that doesn't require subscribing to any API calls.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
21774
0.03%364
0.28%1
Infinity%