Deno

D

Deno

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

Join Server
Llyhokia3/5/2024

How to rewrite this code so I don't have to force deno to stop linting?

```ts import { parse } from "https://deno.land/std@0.218.2/toml/mod.ts"; import { match } from "npm:ts-pattern@5.0.8"; // suppose options.config might be either string or undefined const readToml = match(options.config)...
Mmallquest3/4/2024

Deno compile optimization

Hi Everyone, I'm building a CLI tool with Deno and I was wondering - if there are any optimizations I can make for the compiled file size, - how much of the build in terms of KB is the runtime...
TTavanogui3/4/2024

Is there a way to select Partial Mode on button?

I researched and I do not think it is possible, but it would be nice to do something like:
<a f-partial="/my-link" f-mode="append">Append Mode</a>
<a f-partial="/my-link" f-mode="replace">Replace Mode</a>
<a f-partial="/my-link" f-mode="append">Append Mode</a>
<a f-partial="/my-link" f-mode="replace">Replace Mode</a>
...
Kkj-1010-14143/4/2024

How to Restart Server Manually

I run Hono framework with Deno. I run the server using task script deno run -A --watch ./server/main.js. But somehow, I want to watch changes in a directory which is out of reach and restart the server when a change occur in that directory. I guess I need --watch programmatically. I tried looking in the docs but found none. So, how can I watch and restart server manually?...
HMHong Minhee3/4/2024

Is there any reference manual for how doc comments are rendered on JSR or deno.land/x?

I guessed it's just TSDoc, but it turns out that it's not exactly TSDoc (e.g., @link to an instance method apparently does not work).
TMTimo Martinson3/3/2024

How to start using data validation in kv?

Hey fellows! I want to dive into data validation. Any experience or suggestions? Feel free to post a commented version of the repository I provided here:...
Sshultz3/3/2024

deno cache isn't working from vscode

When initializing a new fresh project from the cli script deno run -A -r https://fresh.deno.dev and opening it in vscode no dependency can be cached and the deno extension output shows: Import map diagnostics: - Invalid top-level key "lint". Only "imports" and "scopes" can be present. - Invalid top-level key "compilerOptions" ......
No description
DLDavid Luis3/3/2024

`.read()` method in `Deno.Conn` or `Deno.FsFile` in Deno 2.0

After Deno.Reader is removed in v2.0, will we still be able to use .read() method in Deno.Conn or Deno.FsFile?
Ssimonw3/2/2024

Stuck trying to install a JSR package with its dependencies and use it in a browser

I published https://jsr.io/@datasette/table to JSR - an experimental web component package - and now I want to install and use it. I'm not at all fluent with the JavaScript ecosystem so I'm likely making some very basic mistakes Here are my notes on what I've tried so far - ideally I want to use esbuild for this: https://til.simonwillison.net/javascript/jsr-esbuild The error I'm seeing is this:...
TThomas3/2/2024

List of available demo commands

Is there a programmatic way to get a list of all possible deno commands? Something like: ```ts const commands = ['run', 'test', ...]!...
Bbittere3/2/2024

Server isolates cause Socket.IO problems

Hi guys, I have a simple socket.IO program that basically broadcasts the changes in any one client's input field to every other client's input field. But I've seen that since Deno Deploy runs the different servers on the edge, different socket.IO servers are run for users from different locations. This means that eg. someone sitting in Asia and making a change won't affect the input of someone sitting in Europe....
DDNA3/2/2024

Puppeteer: "BadResource: Bad resource ID" on Ubuntu

Hello, i just switched my server os over to ubuntu server 23.10. When executing my script, it immediately throws an error an exits. Before, on my windows machine, the script worked completely fine. Error: ``` error: Uncaught (in promise) BadResource: Bad resource ID...
No description
Mmonero3/2/2024

Unable to use Deno.createHttpClient without deprecated flag --unstable

I expected it to be behind the newer --unstable-net flag
OCOuter Cloud3/2/2024

Multiple JsRuntimes crashe if first is not dropped before a second is created and ran

In my application, I want an op2 to take in a function which will be stored in a struct as a Global<v8::Function>. Later this function will be called. This issue is the application crashes with Memory Access Violation. However, this only occurs on the second instance of the JsRuntime. Additionally this doesn't happen for the first few call, which leads me to believe it is something with the handle be garbage collected.
DDeepRobin3/1/2024

Structure microservices

Hi, how would you structure a Deno microservice repository with a good developer experience (good debugging, ..., communication using message brokers)? Do you have any example?...
KKay3/1/2024

Get image from automated download

I have this page which displays a render using threejs and renders it into a png and downloads it. i need that image to use it in a canvas from deno-canvas but when i download it using this package it returns this:
error: Uncaught (in promise) Error: The filename, directory name, or volume label syntax is incorrect. (os error 123): writefile 'C:\Users\titul\AppData\Local\Temp\deno_dwld2b5d29e3bc7dd136/E:\Arcunis\recipeImageMaker\stone.png'
error: Uncaught (in promise) Error: The filename, directory name, or volume label syntax is incorrect. (os error 123): writefile 'C:\Users\titul\AppData\Local\Temp\deno_dwld2b5d29e3bc7dd136/E:\Arcunis\recipeImageMaker\stone.png'
code where i download it:|...
KKay3/1/2024

Get image data from automated download

I have this page which displays a render using threejs and renders it into a png and downloads it. i need that image to use it in a canvas from deno-canvas but when i download it using this package it returns this 'C:\Users\titul\AppData\Local\Temp\deno_dwldf3d5cf300f407d23/E:\Arcunis\recipeImageMaker\stone.png' code where i download it:| ```ts import { download } from "https://deno.land/x/download@v2.0.2/mod.ts"; export default async function generateBlock(block: String) {...
KKay3/1/2024

Wait until Deno.Command process has exited

How would i stop code execution until the process has exited? since its not a promise i cant just do await. is there a way and how?
NNestarZ2/29/2024

Why JSX is not working ?

// @deno-types="@types/react" import React from "react"; const A = (): React.ReactElement => <div />; const B = (): React.ReactElement => <A />; ...
Bbageren2/29/2024

Running with --cached-only not working

First I cache all dependencies of my typescript file: deno cache --lock=deno.lock --lock-write server.ts Then I try to execute the file using --cached-only:...
Next