Deno

D

Deno

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

Join

Abusing prototype CryptoKey in `node:crypto`

Is there any way that I can set the prototype of an object to specifically CryptoKey as defined by node:crypto? I am trying to get around some nasty instanceof check in a third-party library which is getting in the way. ```ts import * as krypto from "node:crypto"; Object.setPrototypeOf(foo, krypto.webcrypto.CryptoKey.prototype);...

Async OP that returns value instead of promise

In deno_runtime is possible to have async op that returns the resolved value instead of promise? Kinda like calling tokio's block_on in the op (is it possible)? For my use case i use crate in that uses async but in js I use library that will call this op but it doesn't support async. I there any way to work around this problem?

VS-Code auto import local modules

Hey is there a way to enable some sort of auto import for local modules/files in VS-Code? Currently it only works if the file is opened in an other tab. When I close the tab an try to use autocomplete an exported module from that file it does not auto import. Is there a fix to this? Or some settings? Thanks for any help!...

In memory Deno Kv

Hi there, I am exploring with Deno Kv and it looks great! But my test are failing because I reuse the same database over and over. Is there a way to initialize an in memory version of Deno.Kv ? Something like sqlite in memory (https://www.sqlite.org/inmemorydb.html)?...

Deno Language Server Issue - Attempting to Use KV in Existing Project

Hi! I'm attempting to create a branch of an existing project (utilizing Fresh) and add KV as an experiment. I also just want to establish I do have the latest version of Deno installed and have updated VSCode/the Deno extension. While getting things set up, I updated my vscode folder in the project directory and also made sure to update deno.json to use the unstable flag. Upon trying to add a new file that utilized KV, I noticed I kept getting errors upon typing anything related to the new KV API. I suspected there was something off with the Language server, but upon inspection it seemed to recognize the unstable flag just fine. I decided to quickly fork the tic-tac-toe project referenced in the KV documentation to compare and contrast - it all works fine, even offering up tooltips mentioning that KV is unstable and how to use it. I compared Deno Language Server Status between the two projects, but could not spot a difference. The vscode directories in each project are basically identical....

Twitter API

Is there a easy way to fetch Tweets using Twitter API or something else? (since they put their API cost is 42$k+)

In browser video chat client & server

Hello! How might people go about architecting an in-browser video chat client & server, specifically wanting to stream the client's camera feed to a server I'm hosting. On the client side it seems I can use https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia to get the camera and audio streams. How do I go about piping those streams to the server in a performant way? Unless I'm totally off base, there isn't an in-browser API to send arbitrary UDP packets https://gafferongames.com/post/why_cant_i_send_udp_packets_from_a_browser/, so are websockets the best option here? On the server side are there good libraries to receive packets with video & audio data and relay them onto another client?...

File Permissions on Deno.FileInfo

Hello. As a programming exercise I'm trying to convert a Decimal number into Octal and that Octal representation into a Unix File Permission representation (drwx-). * I have a directory with the number 16877 -> 40755 * I have a file with the number 33188 -> 100644 ...

Deno Fresh - Different POST handlers for different <form>s ?

what's the idiomatic way of handling different POST requests on the same page?

Deno.open() question

Does, when the process terminate, deno close the files if they were opened with Deno.open()?

Manually edit existing KV table

Hello! another day, another question. Is there a way to manually edit KV database to modify an entry? ```json...

Looking to deploy Deno Fresh on VPS using port 443

Hello! I have two questions, I used saaskit as a base. However fresh's start function is using serve() and not serveTls(). The problem is I cannot expose on 443 since I can't provide certificate and key as start options. Any advice? Should I write a custom start function? My second question is about continuous deployment: I have setup a gitlab runner on my VPS that handles the process of running on each new commit, but unlike NPM, the deno runtime is "listening" and the pipeline stays in "running" state. Is there any solution to this?...

Trying to use Deno.serve() for an https static hosting

I was trying to setup an simple hello world response in https on my custom domain.

"https://esm.sh/mercadopago@1.5.15" Is not workin on deploy

"https://esm.sh/mercadopago@1.5.15" Is not workin on deno deploy, any clues? it works on local but on prod it hans wen using...

Simulating physics collisions across isolates

A bit tangential to Deno, but since Deploy uses v8 isolates, it seems that a multiplayer online game that involves collision detection and resolution that runs on Deploy would need to do things a bit differently. Wondering if anyone out there has delved into this before and wouldn’t mind sharing their discoveries?

Deno showing node globalThis error

Deno is showing this error:
error: Uncaught ReferenceError: __DENO_NODE_GLOBAL_THIS_0_43_0__ is not defined
at file:///home/ren/coding/frontend/packit/node_modules/@reejs/imports/env.js:1:18
error: Uncaught ReferenceError: __DENO_NODE_GLOBAL_THIS_0_43_0__ is not defined
at file:///home/ren/coding/frontend/packit/node_modules/@reejs/imports/env.js:1:18
...