daimon
daimon•4mo ago

I can't download fetch

Can you help me with this? I have just started my deno.js trials 🙂
No description
No description
17 Replies
marvinh.
marvinh.•4mo ago
There is no need to use a dependency for fetch(). That's a built-in global function in Deno, similar to the one in the browser. So simply remove the import fetch from "..." statement
daimon
daimon•4mo ago
Now I'm getting an error like this
daimon
daimon•4mo ago
No description
daimon
daimon•4mo ago
No description
marvinh.
marvinh.•4mo ago
Yeah that's correct. The oak module doesn't export a variable called WebSocket. That's what this error means. The WebSocket variable is a global similar to the browser. So you don't need to import WebSocket from anywhere. Deleting that import statement should resolve this
daimon
daimon•4mo ago
Thank you, if I have another problem, I will add it here :) Thank you so much for your help
lucsoft
lucsoft•4mo ago
Yeah in deno the goal is to use "The Platform" @Daimon so most of the Browser api like fetch, Response, Request, uint8array and all that is already included so you don't really need to deal with the proprietary nature of NodeJS API Also have a look into https://deno.land/std@0.221.0?doc The std is a collection of helpfull additions that can be used by deno so if you need to parse like a csv the std got your covered so you don't need to choose f rom these 100 diffrent csv parses :D
daimon
daimon•4mo ago
I can describe the project I have as follows Tracks the vanity urls of the servers where my discord account is located when anything is changed or removed it pulls to my server But since a lot of people have this problem, I need to downgrade MS and Deno.js came to my mind as faster. Even though I am currently running it on VDS, which is located in the US-East of America, both codes with node.js are received faster than deno.js. Is there anything you can recommend to send the URL to the server?
lucsoft
lucsoft•4mo ago
i heard UDP+QUIC is the new kid in town
daimon
daimon•4mo ago
I know more about cyber security, but I don't know much about coding, I'm trying to write by researching. I'm a little behind because I don't have any friends who can help or know. If you want to take a look at my codes, I can send them here or dm.
lucsoft
lucsoft•4mo ago
post it here
daimon
daimon•4mo ago
That's all my codes
lucsoft
lucsoft•4mo ago
are you rocking discord without protection? Why don't use use a discord wrapper, does everything for you
daimon
daimon•4mo ago
What do you mean by wrapper? I don't know much since I haven't seen any examples yet.
daimon
daimon•4mo ago
Thank you so much for your help I didn't succeed
lucsoft
lucsoft•4mo ago
sorry can't help you ethically here.