Deno

D

Deno

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

Join

Hard SQL Query

I have these two tables: one has some records and the 2nd has almost same records but with high priority. I need to get all records from the 1st table, except when there are ones in the 2nd which override the ones in the 1st, in which case records from 2nd would replace the ones from 1st. So I need to get all records in the 1st table and all records from 2nd but replace records from 1st with that from 2nd when they match....
No description

Workspaces with deno deploy

I was playing with the new workspace feature in a repository with two apps (an oak api and a fresh app) and two libraries (lib-a, lib-b). Both apps depend on both libraries. It works fine in local development. But as is, I can't deploy these to deno deploy. I guess that's because the libraries are not automatically added into the code package to be deployed and cannot be resolved remotely. Error I am getting is: The deployment failed: Relative import path "@repo/lib-a" not prefixed with / or ./ or ../ and not in import map from "file:///src/main.ts". Is there a recommended approach to do this? Do I need to use something like rollup to bundle all dependencies and deploy that?...

timeOrigin = undefined on Deno Deploy

Hello guys When i deploy my code on Deno Deploy, I have this error in the logs and it says "ERROR: RangeError: Invalid time value at Date.toISOString ()". It happens because of this line in my code const start = performance.timeOrigin; //undefined I've tried to use Date.now() instead of performance.timeOrigin, and it worked. ...
No description

Detect when the event loop is finished in a Worker

When Deno executes a script, once the script is finalized, the process is terminated. Is there any way to detect that inside a worker? I know I can call self.close() to terminate the worker, but I want to wait until all timers are closed (unawaited promises, etc) and the event loop is clean. Deno does it automatically in the main script, but I don't know if there's a way to detect this state inside a Worker.

Can Deno automatically install peerdeps like NPM does?

I have a framework that bundles Svelte, and Svelte is marked as peer dependency. This works flawlessly when I use npm/pnpm/bun, but with deno run, it's missing all the peer dependencies, and would force the user to install them manually. Is there a recommended solution to this?...

How do I publish a Rust CLI on JSR

I am currently developing a CLI in Rust and would like to make it available to Typescript devs. There are several packages on NPM that wrap a CLI written in Rust or Go (e.g. Supabase CLI, Turborepo). Can I publish such CLI on JSR instead? How to do that?...

What is the correct way of importing members of a workspace?

As title suggests, I am wondering what the correct way of setting up a deno workspace with multiple modules where Module-A imports functions from Module-B? Are there restrictions in circular imports? I was reading over the standard library, but it did not make immediate sense as to how to set this up.

Using Deno.KV outside deno deploy environment, limit problem

Using Deno.KV with kubernetes(k8s) outside deno deploy environment is giving me rateLimit, too many requests error after only 200-300 requests in 2-3 hours. When l was using deno deploy it never happened. l am using Server Sent Events, together with kv.watch to detect changes and update the other clients. Its a real time application. Here is how l am using kv with SSE: ```export const handler: Handlers = {...
No description

Is it possible to use Yarn with Deno?

I like Deno's cache, but I prefer using Yarn because it zips everything

Vue example doesn't work out of the box

Hi! I'm trying out the Deno Vue example from the docs, but the types don't work out of the box. What can I do to make this work? This is my first time giving Deno a shot. This is while the Vite dev server is running, so dependencies have been fetched...
No description

not found ctx.data

The data set in the handler is not reflected, is there any reason for this? ``` import { FreshContext, Handlers } from "$fresh/server.ts"; export const handler: Handlers = {...

node:worker_threads "Module not found"

After compiling the exe with deno compile, executing the exe reports an error "Module not found", but the path is a real script System: windows11 Deno 1.45.5...
No description

Enabling Web APIs embedded

Hi, I'm trying to use the TextEncoder web api in an embedded scenario. Here's what I'm doing: ``` struct NoopTimersPermission; impl deno_web::TimersPermission for NoopTimersPermission {...

Automate Export+Import when using deps.ts pattern in VSCode/LSP

Hey, I wanted to see if there is a way to configure my IDE's (VSCode using the Deno extension) "Quick Fix" feature to automate importing from deps.ts instead of a fully-qualified URL, but in the case where an existing export in deps.ts is not present? To restate, when deps.ts is present and used, I want to automate adding a new export from deps.ts, and then import that exported thing directly in the file I am trying to run the "Quick Fix" from. deps.ts will be recommended as an import origin, but only if the exported thing already exists in deps.ts....
No description

Using Deno to build a plugin system in an app (Rust, Tauri)

hi guys, im working on https://github.com/louis030195/screen-pipe and explore Deno to allow users to write plugins in JS/TS that would run in the Tauri app in the background...

Deno Install <>

How can I use deno install subcommand? Can't find documentation about it nor examples....

Google Cloud Storage library error inside docker, but outside on my pc it's working fine.

The library in question is this :- "@google-cloud/storage": "npm:@google-cloud/storage@^7.11.2", Inside the code, the library simply download a json file from google storage. When I run code outside the docker container locally, it works fine and is able to download the file. The dockerfile I'm currently using is this :- ```dockerfile...

Deno Deploy login issue

After I recreated my Github account with the same email, I could not log in to Deno Deploy anymore. How can i login or delete that old account?

Typing `parseArgs` from `@std/cli` properly

I'm having trouble figuring out how would I type the result of parseArgs with collect setting. ```ts import { parseArgs } from "@std/cli"; const args = parseArgs(Deno.args, { collect: ["path"] });...