Deno

D

Deno

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

Join

Web Cache API: Worth using to skip one kv.get()?

Is it worth caching a response using the Web Cache API just to avoid a single eventually-consistent kv.get() call? I'm wondering if the performance gain is significant enough in this case.

Packages for image creation

Are there any packages (internal or external) for image creation? I just need some basic functionality like fill rectangles and ideally drawing text. I don't need any rendering to the screen, but it needs to save as an image. I'm porting some lower level code that uses raylib, so that's my reference

Local Deno package imports: Use package's deno.json config "exports" map?

I'm working in a Deno workspace where the outer workspace deno.json references a project within (at some sub-dir path). - The project's deno.json uses the "exports" option to map "." to "./src/mod.ts". - The workspace root's deno.json then references this directory in the "imports" map, from "package-a" to "./package-a". ```...

Deno Subhosting Security

At my company I'm validating tools to run untrusted JavaScript code in a sandbox. I played around with Deno Subhosting, but I could not find a way to auth the subhosting deployed url. Is that intended or do I miss something?

Deno not recognizing default export from npm package 'unstorage' as a function

Hello everyone, I am attempting to set up unstorage with the Deno KV driver, as per https://unstorage.unjs.io/drivers/deno When I import the driver and attempt to call it, the LSP reports that denoKVdriver lacks a call signature, and type-checking also fails:...

deno compile tree-shaking

hey. when using deno compile to produce a single binary, is there any tree-shaking performed? specifically, if i perform an import such as import * as yaml from "@std/yaml"; and then only use yaml.parse and yaml.stringify from the module, will the end bundle include the rest of the module, or only those two plus any dependencies?...

NPM package "pg@8.16.0" does not define an export ".".

Hello everyone! I'm relatively new to the deno world and am currently trying to create a simple CRUD API with Fresh. I followed this article: https://deno.com/blog/build-database-app-drizzle and installed pg with deno install npm:pg. However when trying to import it in any form from...

Is there a way to use `tsconfig.json` `compilerOptions.types`?

I just saw that
/// <reference types="npm:@types/serviceworker" />
/// <reference types="npm:@types/serviceworker" />
works in my project, but is there somehow a way to set the type instead in the tsconfig.json file like normal Node/TypeScript projects?...

Incorrect documentation example (partial mocking)

Hi, I'm trying to replicate the example in the partial mocking documentation, but the test fails because it doesn't override the implementation. VSCode also detects that the spy() function should only receive two arguments. How can i fix or do partial mocking? Thanks - jsr:@std/testing/mock 1.0.12...
No description

How to deploy a staging (preview?) branch

Hi, I have successfully deployed my Fresh project's main branch on Deno Deploy using the web ui and github intergration (very cool process by the way). I want to have some kind of stating/testing/preview branch that I can play with, deploy and test before I merge the code into main branch. what is the correct way to do so? I prefer to configure it within the same project. Thank you 🙂...

Supabase Client Causing Resourse Leak During Integration Tests

I have a node project that we are working on porting over to deno for various unrelated reasons. The transition is going relitively smoothly, except for our integration tests. I keep ketting resourse leak issues stemming from a supabase client. As far as i know supabase clients close by themselves, since theres no close method on the client, please not testdata was omitted due to length ```...

Make vscode not treat my client folder as a deno project

I have the Deno extension installed and my project structure looks like this: ``` client/ - ... server /...

Websocket implementation

Hey there, I’ve tried implementing Websockets into my project a few times, but I haven’t had any luck. Could someone please advise me on how to do it? https://gist.github.com/romanindermuehle/2b87cc36fd35a5e2827f7402a9c69dd7...

Cors No 'Access-Control-Allow-Origin'

Hi, im working on a tcg project with oak and deno, but im getting this message: "Access to fetch at 'http://localhost:8000/users/6/cards' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource." Here is how im handling the fetch `` const response = await fetch(http://localhost:8000/users/${userId}/cards`, {...

Dependencies not found from a process that was spawned using Node’s spawn process library

Hi, could anyone check my issue 🙂 Deno doesn’t seem to find dependencies from import map when a process is spawned using Node’s spawn process library. Thanks in advance!...

How do I view CPU time?

I cant seem to find request cpu time related information on the analytics page of the Deno Dashboard. Is that information obfuscated intentionally?

Third-Party Library Uses `window` not `globalThis` Causing Issues.

I'm using a third-party library that just released a new version and when I try to use it I get an error: error: Uncaught (in promise) ReferenceError: window is not defined With further information `` info: window global is not available in Deno 2. hint: Replace window with globalThis`....

Deno check fail

Hi, I'm trying to use the effect packages with deno, most of them are working, but the sql-drizzle package don't: ```json { "imports": {...

launch.json for debugging deno next.js in vs code

While following the official next.js in deno tutorial I can't seem to figure out how to run and debug in vs code. Can someone please suggest the contents for launch.json that would allow debugging the next.js app in the tutorial (https://docs.deno.com/examples/next_tutorial/).
Next