google-finance-quote 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -48
- package/index.d.ts +72 -72
- package/index.js +142 -138
- package/lib/config.js +3 -3
- package/lib/cryptoCurrencyCodesSymbols.js +93 -0
- package/lib/currencyCodesSymbols.js +130 -0
- package/lib/symbols.js +214 -209
- package/package.json +43 -39
package/README.md
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
# google-finance-quote
|
|
2
|
-
Node Google Finance API wrapper for free.
|
|
3
|
-
No API key is required!
|
|
4
|
-
> Note: This results may vary by up to 20 minutes.
|
|
5
|
-
## Usage
|
|
6
|
-
### Get Started
|
|
7
|
-
```js
|
|
8
|
-
const { Finance, symbols } = require("google-finance-quote");
|
|
9
|
-
|
|
10
|
-
console.log(symbols); // Returns available symbols.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
# google-finance-quote
|
|
2
|
+
Node Google Finance API wrapper for free.
|
|
3
|
+
No API key is required!
|
|
4
|
+
> Note: This results may vary by up to 20 minutes.
|
|
5
|
+
## Usage
|
|
6
|
+
### Get Started
|
|
7
|
+
```js
|
|
8
|
+
const { Finance, symbols, currencyCodesSymbols, cryptoCurrencyCodesSymbols } = require("google-finance-quote");
|
|
9
|
+
|
|
10
|
+
console.log(symbols); // Returns available symbols.
|
|
11
|
+
console.log(currencyCodesSymbols); // Returns available currency codes symbols.
|
|
12
|
+
console.log(cryptoCurrencyCodesSymbols); // Returns available crypto currency codes symbols.
|
|
13
|
+
|
|
14
|
+
const finance = new Finance(); // You can use this: new Finance({ from 'USD', to: 'JPY' });
|
|
15
|
+
// You can use http(s) proxies.
|
|
16
|
+
/*
|
|
17
|
+
const proxy = {
|
|
18
|
+
host: 'example.com',
|
|
19
|
+
port: 2000,
|
|
20
|
+
protocol: 'http'
|
|
21
|
+
}
|
|
22
|
+
const finance = new Finance({ proxy });
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
finance
|
|
26
|
+
.setFrom('USD');
|
|
27
|
+
.setTo('JPY');
|
|
28
|
+
|
|
29
|
+
(async () => {
|
|
30
|
+
console.log(await finance.quote()); // { success: true, rate: 150.94225699999998 }
|
|
31
|
+
})();
|
|
32
|
+
```
|
|
33
|
+
### Class
|
|
34
|
+
<strong>Finance({ from?:string, to?:string, proxy?:object })</strong>
|
|
35
|
+
|
|
36
|
+
### Functions
|
|
37
|
+
- <strong>.setFrom(from: string)</strong>
|
|
38
|
+
Set the parameter of from.
|
|
39
|
+
|
|
40
|
+
- <strong>.setTo(to: string)</strong>
|
|
41
|
+
Set the parameter of to.
|
|
42
|
+
|
|
43
|
+
- <strong>.getParam(): object</strong>
|
|
44
|
+
Returns the current param.
|
|
45
|
+
|
|
46
|
+
- <strong>.quote(amount?: number): Promise<{ success: boolean, rate: number }></strong>
|
|
47
|
+
Returns the converted amount based on the exchange rate.
|
|
48
|
+
> Note: If the current rate cannot be obtained due to rate limits or network errors, success: false is returned.
|
|
49
|
+
## Get Support
|
|
50
|
+
<a href="https://discord.gg/yKW8wWKCnS"><img src="https://discordapp.com/api/guilds/1005287561582878800/widget.png?style=banner4" alt="Discord Banner"/></a>
|
package/index.d.ts
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
declare module 'google-finance-quote' {
|
|
2
|
-
/**
|
|
3
|
-
* @interface Proxy
|
|
4
|
-
* @description Interface for proxy parameters.
|
|
5
|
-
* @property {string} host - Proxy host name.
|
|
6
|
-
* @property {number | undefined} - Proxy port number.
|
|
7
|
-
* @property {'http' | 'https'} protocol - Proxy protocol type.
|
|
8
|
-
*/
|
|
9
|
-
interface Proxy {
|
|
10
|
-
host: string;
|
|
11
|
-
port?: number,
|
|
12
|
-
protocol: 'http' | 'https';
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @interface FinanceParams
|
|
17
|
-
* @description Interface for Finance class constructor parameters.
|
|
18
|
-
* @property {string} from - The original currency symbol.
|
|
19
|
-
* @property {string} to - The desired currency symbol.
|
|
20
|
-
* @property {Proxy | undefined} proxy - Proxy options.
|
|
21
|
-
*/
|
|
22
|
-
interface FinanceParams {
|
|
23
|
-
from: string;
|
|
24
|
-
to: string;
|
|
25
|
-
proxy?: Proxy;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @class Finance
|
|
30
|
-
* @description The Finance class is designed to easily check the exchange rate.
|
|
31
|
-
* @param {FinanceParams | undefined} p - The parameters, including p.from and p.to.
|
|
32
|
-
*/
|
|
33
|
-
class Finance {
|
|
34
|
-
private param: FinanceParams;
|
|
35
|
-
|
|
36
|
-
constructor(p?: FinanceParams);
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @function setFrom
|
|
40
|
-
* @description Set the parameter of from.
|
|
41
|
-
* @param {string} from - The original currency symbol.
|
|
42
|
-
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
43
|
-
*/
|
|
44
|
-
setFrom(from: string): Finance;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* @function setTo
|
|
48
|
-
* @description Set the parameter of to.
|
|
49
|
-
* @param {string} to - The desired currency symbol.
|
|
50
|
-
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
51
|
-
*/
|
|
52
|
-
setTo(to: string): Finance;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @function getParam
|
|
56
|
-
* @description Returns the current param.
|
|
57
|
-
* @returns {FinanceParams} Returns the current param.
|
|
58
|
-
*/
|
|
59
|
-
getParam(): FinanceParams;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @async
|
|
63
|
-
* @function quote
|
|
64
|
-
* @description Returns the current finance rate.
|
|
65
|
-
* @param {number} [amount=1] - The amount to convert.
|
|
66
|
-
* @returns {Promise<{ success: boolean; rate: number }>} Returns the converted amount based on the exchange rate.
|
|
67
|
-
*/
|
|
68
|
-
quote(amount?: number): Promise<{ success: boolean; rate: number }>;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export = Finance;
|
|
72
|
-
}
|
|
1
|
+
declare module 'google-finance-quote' {
|
|
2
|
+
/**
|
|
3
|
+
* @interface Proxy
|
|
4
|
+
* @description Interface for proxy parameters.
|
|
5
|
+
* @property {string} host - Proxy host name.
|
|
6
|
+
* @property {number | undefined} - Proxy port number.
|
|
7
|
+
* @property {'http' | 'https'} protocol - Proxy protocol type.
|
|
8
|
+
*/
|
|
9
|
+
interface Proxy {
|
|
10
|
+
host: string;
|
|
11
|
+
port?: number,
|
|
12
|
+
protocol: 'http' | 'https';
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @interface FinanceParams
|
|
17
|
+
* @description Interface for Finance class constructor parameters.
|
|
18
|
+
* @property {string} from - The original currency symbol.
|
|
19
|
+
* @property {string} to - The desired currency symbol.
|
|
20
|
+
* @property {Proxy | undefined} proxy - Proxy options.
|
|
21
|
+
*/
|
|
22
|
+
interface FinanceParams {
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
proxy?: Proxy;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @class Finance
|
|
30
|
+
* @description The Finance class is designed to easily check the exchange rate.
|
|
31
|
+
* @param {FinanceParams | undefined} p - The parameters, including p.from and p.to.
|
|
32
|
+
*/
|
|
33
|
+
class Finance {
|
|
34
|
+
private param: FinanceParams;
|
|
35
|
+
|
|
36
|
+
constructor(p?: FinanceParams);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @function setFrom
|
|
40
|
+
* @description Set the parameter of from.
|
|
41
|
+
* @param {string} from - The original currency symbol.
|
|
42
|
+
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
43
|
+
*/
|
|
44
|
+
setFrom(from: string): Finance;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @function setTo
|
|
48
|
+
* @description Set the parameter of to.
|
|
49
|
+
* @param {string} to - The desired currency symbol.
|
|
50
|
+
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
51
|
+
*/
|
|
52
|
+
setTo(to: string): Finance;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @function getParam
|
|
56
|
+
* @description Returns the current param.
|
|
57
|
+
* @returns {FinanceParams} Returns the current param.
|
|
58
|
+
*/
|
|
59
|
+
getParam(): FinanceParams;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @async
|
|
63
|
+
* @function quote
|
|
64
|
+
* @description Returns the current finance rate.
|
|
65
|
+
* @param {number} [amount=1] - The amount to convert.
|
|
66
|
+
* @returns {Promise<{ success: boolean; rate: number }>} Returns the converted amount based on the exchange rate.
|
|
67
|
+
*/
|
|
68
|
+
quote(amount?: number): Promise<{ success: boolean; rate: number }>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export = Finance;
|
|
72
|
+
}
|
package/index.js
CHANGED
|
@@ -1,138 +1,142 @@
|
|
|
1
|
-
const axios = require('axios');
|
|
2
|
-
const HttpsProxyAgent = require('https-proxy-agent');
|
|
3
|
-
const { API_URL } = require('./lib/config');
|
|
4
|
-
const symbols = require('./lib/symbols');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @class Finance
|
|
8
|
-
* @description The Finance class is designed to easily check the exchange rate.
|
|
9
|
-
* @param {Object} p - The param includes p.from and p.to.
|
|
10
|
-
* @param {string} p.from - The original currency symbol.
|
|
11
|
-
* @param {string} p.to - The desired currency symbol.
|
|
12
|
-
* @param {object | undefined} p.proxy - Proxy options.
|
|
13
|
-
*/
|
|
14
|
-
class Finance {
|
|
15
|
-
constructor(p) {
|
|
16
|
-
if (
|
|
17
|
-
typeof p === 'object' &&
|
|
18
|
-
(
|
|
19
|
-
symbols.includes(p.from?.toUpperCase()) ||
|
|
20
|
-
symbols.includes(p.to?.toUpperCase())
|
|
21
|
-
)
|
|
22
|
-
) {
|
|
23
|
-
this.param = {
|
|
24
|
-
from: p.from?.toUpperCase() || null,
|
|
25
|
-
to: p.to?.toUpperCase() || null
|
|
26
|
-
};
|
|
27
|
-
} else if (typeof p === 'undefined') {
|
|
28
|
-
this.param = {
|
|
29
|
-
from: null,
|
|
30
|
-
to: null
|
|
31
|
-
};
|
|
32
|
-
} else throw new Error('Invalid parameters.');
|
|
33
|
-
|
|
34
|
-
this.proxy = {};
|
|
35
|
-
if (typeof p?.proxy === 'object') {
|
|
36
|
-
if (
|
|
37
|
-
typeof p.proxy?.host === 'string' &&
|
|
38
|
-
(
|
|
39
|
-
p.proxy.protocol === 'http' ||
|
|
40
|
-
p.proxy.protocol === 'https'
|
|
41
|
-
)
|
|
42
|
-
) {
|
|
43
|
-
this.proxy.host = p.proxy.host;
|
|
44
|
-
if (typeof p.proxy?.port === 'number') this.proxy.port = p.proxy.port;
|
|
45
|
-
this.proxy.protocol = p.proxy.protocol;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @function setFrom
|
|
52
|
-
* @description Set the parameter of from.
|
|
53
|
-
* @param {string} from - The original currency symbol.
|
|
54
|
-
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
55
|
-
*/
|
|
56
|
-
setFrom(from) {
|
|
57
|
-
if (!symbols.includes(from?.toUpperCase())) throw new Error('invalid from.');
|
|
58
|
-
this.param.from = from.toUpperCase();
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @function setTo
|
|
64
|
-
* @description Set the parameter of to.
|
|
65
|
-
* @param {string} to - The desired currency symbol.
|
|
66
|
-
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
67
|
-
*/
|
|
68
|
-
setTo(to) {
|
|
69
|
-
if (!symbols.includes(to?.toUpperCase())) throw new Error('invalid to.');
|
|
70
|
-
this.param.to = to.toUpperCase();
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @function getParam
|
|
76
|
-
* @description Returns the current param.
|
|
77
|
-
* @returns Returns the current param.
|
|
78
|
-
*/
|
|
79
|
-
getParam() {
|
|
80
|
-
return this.param;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @async
|
|
85
|
-
* @function quote
|
|
86
|
-
* @description Returns the current finance.
|
|
87
|
-
* @param {number} [amount=1] - The amount to convert.
|
|
88
|
-
* @returns Returns the current finance.
|
|
89
|
-
*/
|
|
90
|
-
async quote(amount = 1) {
|
|
91
|
-
const result = { success: false, rate: 0 };
|
|
92
|
-
try {
|
|
93
|
-
if (typeof amount !== 'number') throw new Error('amount must be number.');
|
|
94
|
-
const from = this.param.from, to = this.param.to;
|
|
95
|
-
if (!symbols?.includes(from) || !symbols?.includes(to)) throw new Error('from and/or to are invalid.');
|
|
96
|
-
|
|
97
|
-
const url = `${API_URL}${from}-${to}`;
|
|
98
|
-
|
|
99
|
-
let response;
|
|
100
|
-
if (this.proxy) {
|
|
101
|
-
const axiosConfig = {};
|
|
102
|
-
if (this.proxy.protocol === 'http') {
|
|
103
|
-
axiosConfig.proxy = {
|
|
104
|
-
host: this.proxy.host,
|
|
105
|
-
}
|
|
106
|
-
if (this.proxy.port) axiosConfig.proxy.port = this.proxy.port;
|
|
107
|
-
} else if (this.proxy.protocol === 'https') {
|
|
108
|
-
const proxyUrl = `http://${this.proxy.host}${this.proxy.port ? `:${this.proxy.port}` : ''}`;
|
|
109
|
-
const agent = new HttpsProxyAgent(proxyUrl);
|
|
110
|
-
axiosConfig.httpsAgent = agent;
|
|
111
|
-
axiosConfig.proxy = false;
|
|
112
|
-
}
|
|
113
|
-
response = await axios.get(url, axiosConfig);
|
|
114
|
-
} else {
|
|
115
|
-
response = await axios.get(url);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const html = response.data;
|
|
119
|
-
const startIndex =
|
|
120
|
-
html.indexOf(
|
|
121
|
-
`data-source="${from}" data-target="${to}" data-last-price="`
|
|
122
|
-
) +
|
|
123
|
-
`data-source="${from}" data-target="${to}" data-last-price="`.length;
|
|
124
|
-
const endIndex = html.indexOf('"', startIndex);
|
|
125
|
-
const rate = Number(html.substring(startIndex, endIndex));
|
|
126
|
-
if (isNaN(rate)) throw new Error('Failed to get the current finance.');
|
|
127
|
-
|
|
128
|
-
result.success = true;
|
|
129
|
-
result.rate = rate * amount;
|
|
130
|
-
return result;
|
|
131
|
-
} catch {
|
|
132
|
-
return result;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
module.exports
|
|
138
|
-
|
|
1
|
+
const axios = require('axios');
|
|
2
|
+
const HttpsProxyAgent = require('https-proxy-agent');
|
|
3
|
+
const { API_URL } = require('./lib/config');
|
|
4
|
+
const symbols = require('./lib/symbols');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @class Finance
|
|
8
|
+
* @description The Finance class is designed to easily check the exchange rate.
|
|
9
|
+
* @param {Object} p - The param includes p.from and p.to.
|
|
10
|
+
* @param {string} p.from - The original currency symbol.
|
|
11
|
+
* @param {string} p.to - The desired currency symbol.
|
|
12
|
+
* @param {object | undefined} p.proxy - Proxy options.
|
|
13
|
+
*/
|
|
14
|
+
class Finance {
|
|
15
|
+
constructor(p) {
|
|
16
|
+
if (
|
|
17
|
+
typeof p === 'object' &&
|
|
18
|
+
(
|
|
19
|
+
symbols.includes(p.from?.toUpperCase()) ||
|
|
20
|
+
symbols.includes(p.to?.toUpperCase())
|
|
21
|
+
)
|
|
22
|
+
) {
|
|
23
|
+
this.param = {
|
|
24
|
+
from: p.from?.toUpperCase() || null,
|
|
25
|
+
to: p.to?.toUpperCase() || null
|
|
26
|
+
};
|
|
27
|
+
} else if (typeof p === 'undefined') {
|
|
28
|
+
this.param = {
|
|
29
|
+
from: null,
|
|
30
|
+
to: null
|
|
31
|
+
};
|
|
32
|
+
} else throw new Error('Invalid parameters.');
|
|
33
|
+
|
|
34
|
+
this.proxy = {};
|
|
35
|
+
if (typeof p?.proxy === 'object') {
|
|
36
|
+
if (
|
|
37
|
+
typeof p.proxy?.host === 'string' &&
|
|
38
|
+
(
|
|
39
|
+
p.proxy.protocol === 'http' ||
|
|
40
|
+
p.proxy.protocol === 'https'
|
|
41
|
+
)
|
|
42
|
+
) {
|
|
43
|
+
this.proxy.host = p.proxy.host;
|
|
44
|
+
if (typeof p.proxy?.port === 'number') this.proxy.port = p.proxy.port;
|
|
45
|
+
this.proxy.protocol = p.proxy.protocol;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @function setFrom
|
|
52
|
+
* @description Set the parameter of from.
|
|
53
|
+
* @param {string} from - The original currency symbol.
|
|
54
|
+
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
55
|
+
*/
|
|
56
|
+
setFrom(from) {
|
|
57
|
+
if (!symbols.includes(from?.toUpperCase())) throw new Error('invalid from.');
|
|
58
|
+
this.param.from = from.toUpperCase();
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @function setTo
|
|
64
|
+
* @description Set the parameter of to.
|
|
65
|
+
* @param {string} to - The desired currency symbol.
|
|
66
|
+
* @returns {Finance} Returns the instance of Finance for chaining.
|
|
67
|
+
*/
|
|
68
|
+
setTo(to) {
|
|
69
|
+
if (!symbols.includes(to?.toUpperCase())) throw new Error('invalid to.');
|
|
70
|
+
this.param.to = to.toUpperCase();
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @function getParam
|
|
76
|
+
* @description Returns the current param.
|
|
77
|
+
* @returns Returns the current param.
|
|
78
|
+
*/
|
|
79
|
+
getParam() {
|
|
80
|
+
return this.param;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* @async
|
|
85
|
+
* @function quote
|
|
86
|
+
* @description Returns the current finance.
|
|
87
|
+
* @param {number} [amount=1] - The amount to convert.
|
|
88
|
+
* @returns Returns the current finance.
|
|
89
|
+
*/
|
|
90
|
+
async quote(amount = 1) {
|
|
91
|
+
const result = { success: false, rate: 0 };
|
|
92
|
+
try {
|
|
93
|
+
if (typeof amount !== 'number') throw new Error('amount must be number.');
|
|
94
|
+
const from = this.param.from, to = this.param.to;
|
|
95
|
+
if (!symbols?.includes(from) || !symbols?.includes(to)) throw new Error('from and/or to are invalid.');
|
|
96
|
+
|
|
97
|
+
const url = `${API_URL}${from}-${to}`;
|
|
98
|
+
|
|
99
|
+
let response;
|
|
100
|
+
if (this.proxy) {
|
|
101
|
+
const axiosConfig = {};
|
|
102
|
+
if (this.proxy.protocol === 'http') {
|
|
103
|
+
axiosConfig.proxy = {
|
|
104
|
+
host: this.proxy.host,
|
|
105
|
+
}
|
|
106
|
+
if (this.proxy.port) axiosConfig.proxy.port = this.proxy.port;
|
|
107
|
+
} else if (this.proxy.protocol === 'https') {
|
|
108
|
+
const proxyUrl = `http://${this.proxy.host}${this.proxy.port ? `:${this.proxy.port}` : ''}`;
|
|
109
|
+
const agent = new HttpsProxyAgent(proxyUrl);
|
|
110
|
+
axiosConfig.httpsAgent = agent;
|
|
111
|
+
axiosConfig.proxy = false;
|
|
112
|
+
}
|
|
113
|
+
response = await axios.get(url, axiosConfig);
|
|
114
|
+
} else {
|
|
115
|
+
response = await axios.get(url);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const html = response.data;
|
|
119
|
+
const startIndex =
|
|
120
|
+
html.indexOf(
|
|
121
|
+
`data-source="${from}" data-target="${to}" data-last-price="`
|
|
122
|
+
) +
|
|
123
|
+
`data-source="${from}" data-target="${to}" data-last-price="`.length;
|
|
124
|
+
const endIndex = html.indexOf('"', startIndex);
|
|
125
|
+
const rate = Number(html.substring(startIndex, endIndex));
|
|
126
|
+
if (isNaN(rate)) throw new Error('Failed to get the current finance.');
|
|
127
|
+
|
|
128
|
+
result.success = true;
|
|
129
|
+
result.rate = rate * amount;
|
|
130
|
+
return result;
|
|
131
|
+
} catch {
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
module.exports = {
|
|
138
|
+
Finance,
|
|
139
|
+
symbols,
|
|
140
|
+
currencyCodesSymbols: require('./lib/currencyCodesSymbols'),
|
|
141
|
+
cryptocurrencyCodesSymbols: require('./lib/cryptoCurrencyCodesSymbols')
|
|
142
|
+
};
|
package/lib/config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
API_URL: 'https://www.google.com/finance/quote/'
|
|
3
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
API_URL: 'https://www.google.com/finance/quote/'
|
|
3
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list of crypto currency codes.
|
|
3
|
+
*
|
|
4
|
+
* @type {string[]}
|
|
5
|
+
*/
|
|
6
|
+
const cryptocurrencyCodesSymbols = [
|
|
7
|
+
// Cryptocurrency Codes
|
|
8
|
+
'BTC',
|
|
9
|
+
'ETH',
|
|
10
|
+
'ADA',
|
|
11
|
+
'BNB',
|
|
12
|
+
'USDT',
|
|
13
|
+
'XRP',
|
|
14
|
+
'DOGE',
|
|
15
|
+
'LINK',
|
|
16
|
+
'LTC',
|
|
17
|
+
'BCH',
|
|
18
|
+
'XLM',
|
|
19
|
+
'TRX',
|
|
20
|
+
'ETC',
|
|
21
|
+
'XMR',
|
|
22
|
+
'EOS',
|
|
23
|
+
'NEO',
|
|
24
|
+
'WAVES',
|
|
25
|
+
'DASH',
|
|
26
|
+
'OMG',
|
|
27
|
+
'DCR',
|
|
28
|
+
'XEM',
|
|
29
|
+
'MANA',
|
|
30
|
+
'ICX',
|
|
31
|
+
'QTUM',
|
|
32
|
+
'ZIL',
|
|
33
|
+
'BAT',
|
|
34
|
+
'BTG',
|
|
35
|
+
'BNT',
|
|
36
|
+
'ZRX',
|
|
37
|
+
'SC',
|
|
38
|
+
'ONT',
|
|
39
|
+
'DGB',
|
|
40
|
+
'NANO',
|
|
41
|
+
'LSK',
|
|
42
|
+
'GNO',
|
|
43
|
+
'XVG',
|
|
44
|
+
'ARDR',
|
|
45
|
+
'SNT',
|
|
46
|
+
'MAID',
|
|
47
|
+
'REP',
|
|
48
|
+
'ARK',
|
|
49
|
+
'FUN',
|
|
50
|
+
'STEEM',
|
|
51
|
+
'SYS',
|
|
52
|
+
'BTS',
|
|
53
|
+
'KMD',
|
|
54
|
+
'MONA',
|
|
55
|
+
'GAS',
|
|
56
|
+
'RDD',
|
|
57
|
+
'BTM',
|
|
58
|
+
'WTC',
|
|
59
|
+
'AION',
|
|
60
|
+
'GRS',
|
|
61
|
+
'BCN',
|
|
62
|
+
'VERI',
|
|
63
|
+
'DGD',
|
|
64
|
+
'PIVX',
|
|
65
|
+
'NXS',
|
|
66
|
+
'PPT',
|
|
67
|
+
'QASH',
|
|
68
|
+
'NEBL',
|
|
69
|
+
'SALT',
|
|
70
|
+
'GAME',
|
|
71
|
+
'FCT',
|
|
72
|
+
'NXT',
|
|
73
|
+
'PAY',
|
|
74
|
+
'XDN',
|
|
75
|
+
'SUB',
|
|
76
|
+
'KNC',
|
|
77
|
+
'GNT',
|
|
78
|
+
'REQ',
|
|
79
|
+
'VGX',
|
|
80
|
+
'TNB',
|
|
81
|
+
'ZCL',
|
|
82
|
+
'HSR',
|
|
83
|
+
'ICN',
|
|
84
|
+
'POWR',
|
|
85
|
+
'ENG',
|
|
86
|
+
'SAN',
|
|
87
|
+
'ELF',
|
|
88
|
+
'STRAT',
|
|
89
|
+
'QSP',
|
|
90
|
+
'RDN'
|
|
91
|
+
];
|
|
92
|
+
|
|
93
|
+
module.exports = cryptocurrencyCodesSymbols;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A list of currency codes.
|
|
3
|
+
*
|
|
4
|
+
* @type {string[]}
|
|
5
|
+
*/
|
|
6
|
+
const currencyCodesSymbols = [
|
|
7
|
+
// Currency Codes
|
|
8
|
+
'AED',
|
|
9
|
+
'AFN',
|
|
10
|
+
'ALL',
|
|
11
|
+
'AMD',
|
|
12
|
+
'ANG',
|
|
13
|
+
'ARS',
|
|
14
|
+
'AUD',
|
|
15
|
+
'AWG',
|
|
16
|
+
'AZN',
|
|
17
|
+
'BAM',
|
|
18
|
+
'BDT',
|
|
19
|
+
'BGN',
|
|
20
|
+
'BHD',
|
|
21
|
+
'BND',
|
|
22
|
+
'BOB',
|
|
23
|
+
'BRL',
|
|
24
|
+
'BTN',
|
|
25
|
+
'BWP',
|
|
26
|
+
'BYN',
|
|
27
|
+
'BZD',
|
|
28
|
+
'CAD',
|
|
29
|
+
'CHF',
|
|
30
|
+
'CLP',
|
|
31
|
+
'CNY',
|
|
32
|
+
'COP',
|
|
33
|
+
'CRC',
|
|
34
|
+
'CSD',
|
|
35
|
+
'CZK',
|
|
36
|
+
'CVE',
|
|
37
|
+
'DEM',
|
|
38
|
+
'DKK',
|
|
39
|
+
'DOP',
|
|
40
|
+
'DZD',
|
|
41
|
+
'EEK',
|
|
42
|
+
'EGP',
|
|
43
|
+
'EUR',
|
|
44
|
+
'FJD',
|
|
45
|
+
'FRF',
|
|
46
|
+
'GBP',
|
|
47
|
+
'GEL',
|
|
48
|
+
'GHS',
|
|
49
|
+
'HKD',
|
|
50
|
+
'HNL',
|
|
51
|
+
'HRK',
|
|
52
|
+
'HUF',
|
|
53
|
+
'IDR',
|
|
54
|
+
'ILS',
|
|
55
|
+
'INR',
|
|
56
|
+
'IQD',
|
|
57
|
+
'ISK',
|
|
58
|
+
'JMD',
|
|
59
|
+
'JOD',
|
|
60
|
+
'JPY',
|
|
61
|
+
'KES',
|
|
62
|
+
'KGS',
|
|
63
|
+
'KRW',
|
|
64
|
+
'KWD',
|
|
65
|
+
'KYD',
|
|
66
|
+
'KZT',
|
|
67
|
+
'LAK',
|
|
68
|
+
'LBP',
|
|
69
|
+
'LKR',
|
|
70
|
+
'LTL',
|
|
71
|
+
'MAD',
|
|
72
|
+
'MDL',
|
|
73
|
+
'MKD',
|
|
74
|
+
'MMK',
|
|
75
|
+
'MOP',
|
|
76
|
+
'MTL',
|
|
77
|
+
'MUR',
|
|
78
|
+
'MVR',
|
|
79
|
+
'MXN',
|
|
80
|
+
'MYR',
|
|
81
|
+
'NAD',
|
|
82
|
+
'NGN',
|
|
83
|
+
'NIO',
|
|
84
|
+
'NOK',
|
|
85
|
+
'NPR',
|
|
86
|
+
'NZD',
|
|
87
|
+
'OMR',
|
|
88
|
+
'PAB',
|
|
89
|
+
'PEN',
|
|
90
|
+
'PHP',
|
|
91
|
+
'PKR',
|
|
92
|
+
'PLN',
|
|
93
|
+
'PYG',
|
|
94
|
+
'QAR',
|
|
95
|
+
'RON',
|
|
96
|
+
'ROL',
|
|
97
|
+
'RSD',
|
|
98
|
+
'RUB',
|
|
99
|
+
'SAR',
|
|
100
|
+
'SCR',
|
|
101
|
+
'SEK',
|
|
102
|
+
'SGD',
|
|
103
|
+
'SIT',
|
|
104
|
+
'SKK',
|
|
105
|
+
'SVC',
|
|
106
|
+
'THB',
|
|
107
|
+
'TND',
|
|
108
|
+
'TRL',
|
|
109
|
+
'TRY',
|
|
110
|
+
'TTD',
|
|
111
|
+
'TWD',
|
|
112
|
+
'TZS',
|
|
113
|
+
'UAH',
|
|
114
|
+
'UGX',
|
|
115
|
+
'USD',
|
|
116
|
+
'UYU',
|
|
117
|
+
'UZS',
|
|
118
|
+
'VEB',
|
|
119
|
+
'VEF',
|
|
120
|
+
'VES',
|
|
121
|
+
'VND',
|
|
122
|
+
'WST',
|
|
123
|
+
'XCD',
|
|
124
|
+
'XOF',
|
|
125
|
+
'XPF',
|
|
126
|
+
'YER',
|
|
127
|
+
'ZAR'
|
|
128
|
+
];
|
|
129
|
+
|
|
130
|
+
module.exports = currencyCodesSymbols;
|
package/lib/symbols.js
CHANGED
|
@@ -1,209 +1,214 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
'
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'
|
|
25
|
-
'
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
35
|
-
'
|
|
36
|
-
'
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
'
|
|
48
|
-
'
|
|
49
|
-
'
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
'
|
|
58
|
-
'
|
|
59
|
-
'
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
65
|
-
'
|
|
66
|
-
'
|
|
67
|
-
'
|
|
68
|
-
'
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
77
|
-
'
|
|
78
|
-
'
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
'
|
|
82
|
-
'
|
|
83
|
-
'
|
|
84
|
-
'
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
'
|
|
89
|
-
'
|
|
90
|
-
'
|
|
91
|
-
'
|
|
92
|
-
'
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
'
|
|
96
|
-
'
|
|
97
|
-
'
|
|
98
|
-
'
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
'
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
116
|
-
'
|
|
117
|
-
'
|
|
118
|
-
'
|
|
119
|
-
'
|
|
120
|
-
'
|
|
121
|
-
'
|
|
122
|
-
'
|
|
123
|
-
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'
|
|
128
|
-
|
|
129
|
-
'
|
|
130
|
-
'
|
|
131
|
-
'
|
|
132
|
-
'
|
|
133
|
-
'
|
|
134
|
-
'
|
|
135
|
-
'
|
|
136
|
-
'
|
|
137
|
-
'
|
|
138
|
-
'
|
|
139
|
-
'
|
|
140
|
-
'
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
'
|
|
146
|
-
'
|
|
147
|
-
'
|
|
148
|
-
'
|
|
149
|
-
'
|
|
150
|
-
'
|
|
151
|
-
'
|
|
152
|
-
'
|
|
153
|
-
'
|
|
154
|
-
'
|
|
155
|
-
'
|
|
156
|
-
'
|
|
157
|
-
'
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
161
|
-
'
|
|
162
|
-
'
|
|
163
|
-
'
|
|
164
|
-
'
|
|
165
|
-
'
|
|
166
|
-
'
|
|
167
|
-
'
|
|
168
|
-
'
|
|
169
|
-
'
|
|
170
|
-
'
|
|
171
|
-
'
|
|
172
|
-
'
|
|
173
|
-
'
|
|
174
|
-
'
|
|
175
|
-
'
|
|
176
|
-
'
|
|
177
|
-
'
|
|
178
|
-
'
|
|
179
|
-
'
|
|
180
|
-
'
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
'
|
|
184
|
-
'
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
'
|
|
188
|
-
'
|
|
189
|
-
'
|
|
190
|
-
'
|
|
191
|
-
'
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
'
|
|
196
|
-
'
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'
|
|
200
|
-
'
|
|
201
|
-
'
|
|
202
|
-
'
|
|
203
|
-
'
|
|
204
|
-
'
|
|
205
|
-
'
|
|
206
|
-
'
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A list of currency and crypto currency codes.
|
|
3
|
+
*
|
|
4
|
+
* @type {string[]}
|
|
5
|
+
*/
|
|
6
|
+
const symbols = [
|
|
7
|
+
// Currency Codes
|
|
8
|
+
'AED',
|
|
9
|
+
'AFN',
|
|
10
|
+
'ALL',
|
|
11
|
+
'AMD',
|
|
12
|
+
'ANG',
|
|
13
|
+
'ARS',
|
|
14
|
+
'AUD',
|
|
15
|
+
'AWG',
|
|
16
|
+
'AZN',
|
|
17
|
+
'BAM',
|
|
18
|
+
'BDT',
|
|
19
|
+
'BGN',
|
|
20
|
+
'BHD',
|
|
21
|
+
'BND',
|
|
22
|
+
'BOB',
|
|
23
|
+
'BRL',
|
|
24
|
+
'BTN',
|
|
25
|
+
'BWP',
|
|
26
|
+
'BYN',
|
|
27
|
+
'BZD',
|
|
28
|
+
'CAD',
|
|
29
|
+
'CHF',
|
|
30
|
+
'CLP',
|
|
31
|
+
'CNY',
|
|
32
|
+
'COP',
|
|
33
|
+
'CRC',
|
|
34
|
+
'CSD',
|
|
35
|
+
'CZK',
|
|
36
|
+
'CVE',
|
|
37
|
+
'DEM',
|
|
38
|
+
'DKK',
|
|
39
|
+
'DOP',
|
|
40
|
+
'DZD',
|
|
41
|
+
'EEK',
|
|
42
|
+
'EGP',
|
|
43
|
+
'EUR',
|
|
44
|
+
'FJD',
|
|
45
|
+
'FRF',
|
|
46
|
+
'GBP',
|
|
47
|
+
'GEL',
|
|
48
|
+
'GHS',
|
|
49
|
+
'HKD',
|
|
50
|
+
'HNL',
|
|
51
|
+
'HRK',
|
|
52
|
+
'HUF',
|
|
53
|
+
'IDR',
|
|
54
|
+
'ILS',
|
|
55
|
+
'INR',
|
|
56
|
+
'IQD',
|
|
57
|
+
'ISK',
|
|
58
|
+
'JMD',
|
|
59
|
+
'JOD',
|
|
60
|
+
'JPY',
|
|
61
|
+
'KES',
|
|
62
|
+
'KGS',
|
|
63
|
+
'KRW',
|
|
64
|
+
'KWD',
|
|
65
|
+
'KYD',
|
|
66
|
+
'KZT',
|
|
67
|
+
'LAK',
|
|
68
|
+
'LBP',
|
|
69
|
+
'LKR',
|
|
70
|
+
'LTL',
|
|
71
|
+
'MAD',
|
|
72
|
+
'MDL',
|
|
73
|
+
'MKD',
|
|
74
|
+
'MMK',
|
|
75
|
+
'MOP',
|
|
76
|
+
'MTL',
|
|
77
|
+
'MUR',
|
|
78
|
+
'MVR',
|
|
79
|
+
'MXN',
|
|
80
|
+
'MYR',
|
|
81
|
+
'NAD',
|
|
82
|
+
'NGN',
|
|
83
|
+
'NIO',
|
|
84
|
+
'NOK',
|
|
85
|
+
'NPR',
|
|
86
|
+
'NZD',
|
|
87
|
+
'OMR',
|
|
88
|
+
'PAB',
|
|
89
|
+
'PEN',
|
|
90
|
+
'PHP',
|
|
91
|
+
'PKR',
|
|
92
|
+
'PLN',
|
|
93
|
+
'PYG',
|
|
94
|
+
'QAR',
|
|
95
|
+
'RON',
|
|
96
|
+
'ROL',
|
|
97
|
+
'RSD',
|
|
98
|
+
'RUB',
|
|
99
|
+
'SAR',
|
|
100
|
+
'SCR',
|
|
101
|
+
'SEK',
|
|
102
|
+
'SGD',
|
|
103
|
+
'SIT',
|
|
104
|
+
'SKK',
|
|
105
|
+
'SVC',
|
|
106
|
+
'THB',
|
|
107
|
+
'TND',
|
|
108
|
+
'TRL',
|
|
109
|
+
'TRY',
|
|
110
|
+
'TTD',
|
|
111
|
+
'TWD',
|
|
112
|
+
'TZS',
|
|
113
|
+
'UAH',
|
|
114
|
+
'UGX',
|
|
115
|
+
'USD',
|
|
116
|
+
'UYU',
|
|
117
|
+
'UZS',
|
|
118
|
+
'VEB',
|
|
119
|
+
'VEF',
|
|
120
|
+
'VES',
|
|
121
|
+
'VND',
|
|
122
|
+
'WST',
|
|
123
|
+
'XCD',
|
|
124
|
+
'XOF',
|
|
125
|
+
'XPF',
|
|
126
|
+
'YER',
|
|
127
|
+
'ZAR',
|
|
128
|
+
// Cryptocurrency Codes
|
|
129
|
+
'BTC',
|
|
130
|
+
'ETH',
|
|
131
|
+
'ADA',
|
|
132
|
+
'BNB',
|
|
133
|
+
'USDT',
|
|
134
|
+
'XRP',
|
|
135
|
+
'DOGE',
|
|
136
|
+
'LINK',
|
|
137
|
+
'LTC',
|
|
138
|
+
'BCH',
|
|
139
|
+
'XLM',
|
|
140
|
+
'TRX',
|
|
141
|
+
'ETC',
|
|
142
|
+
'XMR',
|
|
143
|
+
'EOS',
|
|
144
|
+
'NEO',
|
|
145
|
+
'WAVES',
|
|
146
|
+
'DASH',
|
|
147
|
+
'OMG',
|
|
148
|
+
'DCR',
|
|
149
|
+
'XEM',
|
|
150
|
+
'MANA',
|
|
151
|
+
'ICX',
|
|
152
|
+
'QTUM',
|
|
153
|
+
'ZIL',
|
|
154
|
+
'BAT',
|
|
155
|
+
'BTG',
|
|
156
|
+
'BNT',
|
|
157
|
+
'ZRX',
|
|
158
|
+
'SC',
|
|
159
|
+
'ONT',
|
|
160
|
+
'DGB',
|
|
161
|
+
'NANO',
|
|
162
|
+
'LSK',
|
|
163
|
+
'GNO',
|
|
164
|
+
'XVG',
|
|
165
|
+
'ARDR',
|
|
166
|
+
'SNT',
|
|
167
|
+
'MAID',
|
|
168
|
+
'REP',
|
|
169
|
+
'ARK',
|
|
170
|
+
'FUN',
|
|
171
|
+
'STEEM',
|
|
172
|
+
'SYS',
|
|
173
|
+
'BTS',
|
|
174
|
+
'KMD',
|
|
175
|
+
'MONA',
|
|
176
|
+
'GAS',
|
|
177
|
+
'RDD',
|
|
178
|
+
'BTM',
|
|
179
|
+
'WTC',
|
|
180
|
+
'AION',
|
|
181
|
+
'GRS',
|
|
182
|
+
'BCN',
|
|
183
|
+
'VERI',
|
|
184
|
+
'DGD',
|
|
185
|
+
'PIVX',
|
|
186
|
+
'NXS',
|
|
187
|
+
'PPT',
|
|
188
|
+
'QASH',
|
|
189
|
+
'NEBL',
|
|
190
|
+
'SALT',
|
|
191
|
+
'GAME',
|
|
192
|
+
'FCT',
|
|
193
|
+
'NXT',
|
|
194
|
+
'PAY',
|
|
195
|
+
'XDN',
|
|
196
|
+
'SUB',
|
|
197
|
+
'KNC',
|
|
198
|
+
'GNT',
|
|
199
|
+
'REQ',
|
|
200
|
+
'VGX',
|
|
201
|
+
'TNB',
|
|
202
|
+
'ZCL',
|
|
203
|
+
'HSR',
|
|
204
|
+
'ICN',
|
|
205
|
+
'POWR',
|
|
206
|
+
'ENG',
|
|
207
|
+
'SAN',
|
|
208
|
+
'ELF',
|
|
209
|
+
'STRAT',
|
|
210
|
+
'QSP',
|
|
211
|
+
'RDN'
|
|
212
|
+
];
|
|
213
|
+
|
|
214
|
+
module.exports = symbols;
|
package/package.json
CHANGED
|
@@ -1,39 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "google-finance-quote",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Node Google Finance API wrapper for free. No API key is required!",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "git+https://github.com/otoneko1102/google-finance-quote.git"
|
|
13
|
-
},
|
|
14
|
-
"keywords": [
|
|
15
|
-
"google",
|
|
16
|
-
"api",
|
|
17
|
-
"finance",
|
|
18
|
-
"exchange",
|
|
19
|
-
"rate",
|
|
20
|
-
"quote",
|
|
21
|
-
"wrapper",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
},
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "google-finance-quote",
|
|
3
|
+
"version": "2.0.4",
|
|
4
|
+
"description": "Node Google Finance API wrapper for free. No API key is required!",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/otoneko1102/google-finance-quote.git"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"google",
|
|
16
|
+
"api",
|
|
17
|
+
"finance",
|
|
18
|
+
"exchange",
|
|
19
|
+
"rate",
|
|
20
|
+
"quote",
|
|
21
|
+
"wrapper",
|
|
22
|
+
"money",
|
|
23
|
+
"code",
|
|
24
|
+
"codes",
|
|
25
|
+
"data",
|
|
26
|
+
"lib",
|
|
27
|
+
"free",
|
|
28
|
+
"proxy"
|
|
29
|
+
],
|
|
30
|
+
"author": "otoneko.",
|
|
31
|
+
"license": "ISC",
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/otoneko1102/google-finance-quote/issues"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/otoneko1102/google-finance-quote#readme",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"axios": "^1.7.9",
|
|
38
|
+
"https-proxy-agent": "^7.0.6"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^22.13.2"
|
|
42
|
+
}
|
|
43
|
+
}
|