Deno

D

Deno

Chat about Deno, a modern runtime for JavaScript and TypeScript.

Join

Connect to a WebSocket through a HTTP(S)/SOCKS5 proxy

Title - I am trying to connect to a wss:// websocket through a proxy of choice at runtime. Is there a way to do this alike to Deno.createHttpClient for regular requests? If not (and I would say it is in fact more complicated), what should I do to achieve this?...

External package code throws error: window is undefined

Hello, I have imported an npm package to my project. And in this package's code, there is a condition: ``` if (typeof window === 'undefined') { throw new Error('Error initializing the sdk: window is undefined');...

Error with imports

I have this fancy peace of code that import a bunch of files from a directory: ``ts const utils = {}; const utilsDirectory = Deno.realPathSync(${Deno.cwd()}/utils`); const utilsFiles = Deno.readDirSync(utilsDirectory);...

Deno.env via file

How can I use set env from a file and get them via deno.env.get() function as i want to push my code to deno deploy

Running LLaMA on Deno

Hello! I use Deno to run my apps on the edge, what Deno solution or other provider would be ideal to run a quantized LLaMA instance? Deno Deploy is against machine learning (even premium tiers?), so what can we use instead to run the llama model?...

Occasional very slow isolate start times

I have a Vue.js app (using Vite) project with a few edge functions running on Deno Deploy. What I'm seeing is that though most page loads are fast, once in a while it will take 4-5s to load the main page. Checking logs, I think the cause is that 'isolate start time' varies wildly from 300ms to 3000ms. I don't understand how it can vary this much - is this expected? Could this be caused by my setup somehow? How do I debug this?...

Changing terminal zoom in windows?

Is it possible to change the terminal zoom using deno? Also, this is about windows terminal, not conhost

Whimsical error shows up when I run a file

I'm trying to make a discord bot with Deno and d.js but for some reasons I get this error
error: Relative import path "@discordjs/util" not prefixed with / or ./ or ../
at file:///C:/Users/andri/AppData/Local/deno/npm/registry.npmjs.org/@discordjs/builders/1.6.5/dist/index.d.ts:4:42
error: Relative import path "@discordjs/util" not prefixed with / or ./ or ../
at file:///C:/Users/andri/AppData/Local/deno/npm/registry.npmjs.org/@discordjs/builders/1.6.5/dist/index.d.ts:4:42
...

I cannot able to install it

when i run
irm https://deno.land/install.ps1 | iex
irm https://deno.land/install.ps1 | iex
i got this error message...
No description

Deno lint custom rules

Hey is there currently a way to create custom rules for Deno lint? And if so how can I specify a custom rule? If there is no way to create custom rules, can I use ESLint with Deno without having to install Node? And I know I can install ESLint as a global „script“ but that still requires Node to be installed. ...

using OpenAI npm in Deno deploy playground:

i don't know how to return the resualt , now this just return [object Object] i don't how to use async await this is my code: import OpenAI from "npm:openai"; const openai = new OpenAI();...

Frontend & Backend in one Deno Deploy project

I have a Nuxt 3 frontend and an Oak backend. Is it technically possible to deploy both in one deno deploy project? And if so, how can I achieve that? Thanks for helping! <:sushi_deno:1002977518833381396>...

Is there a split_to_array function like join_to_string

I need to split a string with some delimiter =[, and ask my self if there is something in deno which i can use for this. https://deno.land/std@0.205.0/collections/join_to_string.ts...

How to set proxy to overall all requests coming from application?

In Node JS, we can import https and set https.proxy = "proxyDetails However, I couldn't find a way to do so in Deno. I even tried to run node js child_process app with proxy over Deno, still not possible....

Overload not typing object literals

shouldn’t only “real” show up as a property here? if not, how could I achieve that?
No description

Making Post Request To HubSpot Api

Hi there I'm trying to make a post request to the HubSpot Api. However the request results in a "HubSpot API responded with status: 401" ´401 Unauthorized is returned when the authentication provided is invalid.´ https://developers.hubspot.com/docs/api/crm/contacts Selected scopes on the HubSpot app: crm.objects.companies.read...

CLI prompt consistent with Deno CLI

I want to make outputs of my CLI tools look consistent with Deno CLI. Is there a rust crate to do that? If not, which source code should I refer to?

cannot set property on fetch response

in the browser this works ```javascript let o = await fetch('https://deno.com'); o.asdf = 2 console.log(o.asdf)//2...

Component testing with Deno

I've run through a zillion possible setups with Deno and I'm still struggling to understand exactly how to do this. I want to write Typescript that transpiles to vanilla web components and I want to run associated unit tests in a component.test.ts that sits beside my component in a folder. I want these unit tests to be able to spin up a dom to test things like saving to localStorage. And I want this to be as simple and minimal as possible. I've explored just writing everything from scratch with Deno, and I couldn't quite grasp how to get esbuild to output my components as separate modules and it looked like I'd have to basically write my own build scripts, like the pre-Gulp days. I have installed vite and tried out vite vanilla, vite-lit, and vite-svelte. I thought vite-svelte was my saviour but again I just couldn't get the testing working. When I tried to install vitest I kept hitting this error: Error: Vitest was initialised with native Node instead of Vite Node and could progress no further. ...

Is there any way to run deno as a cluster on one machine? (like pm2)

I plan to service with deno, but PM2 does NOT support deno. Is there any way to run deno as a cluster on one machine?...