Skip to content

Commit

Permalink
Merge pull request #26 from paul-shuvo/release
Browse files Browse the repository at this point in the history
release: 1.3.0
  • Loading branch information
paul-shuvo committed Mar 25, 2022
2 parents 8eef7bf + 05ea52c commit 1c6c7c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const cheerio = require("cheerio")
const got = require("got")

// FIXME: round upto 2 decimal places
// TODO: Add doc for other functions
class CurrencyConverter {
currencies = {
"AFN": "Afghan Afghani",
Expand Down Expand Up @@ -176,7 +174,6 @@ class CurrencyConverter {
if(params["isDecimalComma"] !== undefined)
this.setDecimalComma(params["isDecimalComma"])
}

}
from (currencyFrom) {
if(typeof currencyFrom !== "string")
Expand Down Expand Up @@ -236,14 +233,7 @@ class CurrencyConverter {
else
return got(`https://www.google.co.in/search?q=${this.currencyAmount}+${this.currencyFrom}+to+${this.currencyTo}+&hl=en`)
.then((html) => {
// const fs = require('fs');

// 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)})
return cheerio.load(html.body)})
.then(($) => {return $(".iBp4i").text().split(" ")[0]})
.then((rates) => {
if(this.isDecimalComma){
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "currency-converter-lt",
"version": "1.2.4",
"version": "1.3.0",
"description": "A nodejs currency converter library that doesn't require subscribing to any API calls.",
"main": "index.js",
"dependencies": {
Expand Down

0 comments on commit 1c6c7c8

Please sign in to comment.