Skip to content

Commit

Permalink
final..
Browse files Browse the repository at this point in the history
  • Loading branch information
mimed100 committed Feb 18, 2022
1 parent b1ffcf0 commit 57cddc8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ There are two different modes for this module.

### Mode 1) Convert Currency with Realtime Data from fixer.io (API-Key required: https://fixer.io/)
```js
import {FiatConverter_fromAPI} from 'https://deno.land/x/currency_converter@v0.9.5/api_mod.ts'
import {FiatConverter_fromAPI} from 'https://deno.land/x/currency_converter@v1.1.0/api_mod.ts'
const api_key = "12ed855902ddbea5df116639e8e3a1b2"
var amount = 100
var input_currency = "EUR"
Expand All @@ -16,7 +16,7 @@ console.log('Result:', result, output_currency)
```
#### Test via commandline (provided API-KEY)
```js
deno run --allow-net "https://deno.land/x/currency_converter@v1.0.4/test_api.ts"
deno run --allow-net "https://deno.land/x/currency_converter@v1.1.0/test_api.ts"
```
#### Output
```js
Expand All @@ -30,11 +30,11 @@ Link: https://fixer.io/
### Mode 2) Convert Currency with copied data from data.json file
```js
// Copy the JSON file into current directory, this file will be used for the currency conversion
import json from 'https://deno.land/x/currency_converter@v1.0.0/data.json' assert { type: 'json' };
import json from 'https://deno.land/x/currency_converter@v1.1.0/data.json' assert { type: 'json' };
const write = Deno.writeTextFile("./data.json", JSON.stringify(json))
write.then(() => console.log("File written to ./data.json"));

import {FiatConverter_fromJSON} from 'https://deno.land/x/currency_converter@v1.0.0/json_mod.ts'
import {FiatConverter_fromJSON} from 'https://deno.land/x/currency_converter@v1.1.0/json_mod.ts'
var amount = 100
var input_currency = "EUR"
var output_currency = "USD"
Expand All @@ -46,7 +46,7 @@ console.log("Result ", result, output_currency)

#### Test via commandline (provided API-KEY)
```js
deno run --allow-net --allow-write --allow-read "https://deno.land/x/currency_converter@v1.0.0/test_json.ts"
deno run --allow-net --allow-write --allow-read "https://deno.land/x/currency_converter@v1.1.0/test_json.ts"
```
#### Output
```js
Expand Down
2 changes: 1 addition & 1 deletion test_api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {FiatConverter_fromAPI} from 'https://deno.land/x/currency_converter@v1.0.0/api_mod.ts'
import {FiatConverter_fromAPI} from 'https://deno.land/x/currency_converter@v1.1.0/api_mod.ts'

const api_key = "12ed855902ddbea5df116639e8e3a1b2"
var amount = 100
Expand Down
4 changes: 2 additions & 2 deletions test_json.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copy the JSON file into current directory, this file will be used for the currency conversion
import json from 'https://deno.land/x/currency_converter@v1.0.0/data.json' assert { type: 'json' };
import json from 'https://deno.land/x/currency_converter@v1.1.0/data.json' assert { type: 'json' };
const write = Deno.writeTextFile("./data.json", JSON.stringify(json))
write.then(() => console.log("File written to ./data.json"));


import {FiatConverter_fromJSON} from 'https://deno.land/x/currency_converter@v1.0.0/json_mod.ts'
import {FiatConverter_fromJSON} from 'https://deno.land/x/currency_converter@v1.1.0/json_mod.ts'

var amount = 100
var input_currency = "EUR"
Expand Down

0 comments on commit 57cddc8

Please sign in to comment.