Skip to content

Commit 3c4c5a0

Browse files
committed
feat: add (friendly) warning when used in the browser
Refs #153
1 parent 519a1d4 commit 3c4c5a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index-browser.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,12 @@ import browserEnvironment from "./env-browser.js";
33

44
yahooFinance._env = browserEnvironment;
55

6+
// NOTE: The repo name is hardcoded, see #167
7+
console.warn(
8+
"⚠️ WARNING! This package (i.e. `yahoo-finance2`) is being used in the browser.",
9+
"Trying to use this may not work because of CORS. Be aware of that (and don't file issues for help with that).",
10+
"You can use a proxy to make CORS errors disappear, but we will not help you with that.",
11+
"Please read the README (https://github.com/gadicc/node-yahoo-finance2) for more details."
12+
);
13+
614
export default yahooFinance;

0 commit comments

Comments
 (0)