Deno

D

Deno

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

Join

getting errno with ffi

I am using ffi to call execv and need to get the value of errno for failures, but can’t see how I can do that.

Purging Kv keys

I have a logger which write logs to a kv store with dual keys, something like ```ts kv.set(["logs_by_time", Date.now()], logObject) kv.set(["logs_by_process", "current-process-id", Date.now()],logObject)...

What is the right way to bundle native modules?

If I'm not able to import a native module with the built-in "import" keyword, what is the ideal way to download and cache them? Should I be fetching it? How should I be caching it locally? Should I make an "install" script? What are the general techniques, does anyone have any examples?

HandleScope in async op

Is there a way to get v8::HandleScope inside async op if I add it as
scope: &mut v8::HandleScope<'a>,
scope: &mut v8::HandleScope<'a>,
...

Deno LSP randomly breaks until a restart (unable to send result to client)

This wasnt an issue until recently. In vscode randomly the lsp stops working. Trying to use the autocomplete or jumping to declaration doesn't working, a restart fixes it for a bit but it ends up breaking again. The lsp is running but ends up creating the error Unable to send result to client. in the logs....

Is anyone working on LLMs for Deno so I don't have to learn it in disgusting Python?

I'm coming to terms with the reality of having to learn this technology but not on Python.. I mean.. very much hopefully not on Python.

Permission denied (os error 13)

Please help me, I'm desparate. It doesn't print anything else.

Handle timeout in WebSocketStream?

How can i handle a timeout exception in an WebSocketStream? Putting a try catch block around it still resullts in an unhandled exception?...

Is there a rich text (wysiwyg) editor for deno fresh ?

I'm working on a blog, and i need a rich text editor for articles.

deno_core usage

Are there any repos using deno_core in their code + how would I enable the unstable features and URL imports?

Error reading `allocUnsafe` using npm:ics

Hello there, I try to use npm:ics in my project and in some runs it works, in others it doesn't (which is pretty weird if you think about it) and I get the following error: ``` error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'allocUnsafe') at fillPool (file:///home/***/.cache/deno/npm/registry.npmjs.org/nanoid/3.3.6/index.cjs:7:19)...

Best way to compile & distribute a Deno CLI program?

Hey! I made a Deno CLI I would like to share, It is a CLI program that I would like the user to install. What is the best way about doing this? I would like this CLI to be installed globally as well, and cross platform.

Using discord.js in Deno?

Apparently Deno supports discord.js now. Awesome. But now I can't make it work. According to debug logs, the Websocket connection is timing out. What could be happening?...

Type alias with inherited type parameter constraints

Is there any way to do this? I want SVLTN to just be a short-name alias for SomeVeryLongTypeName, and I want it to have the same parameter types, but I don't want to have to specify all of them explicitly. ```ts type SomeVeryLongTypeName<A extends ..., B extends ..., ...> = ... type SVLTN<A extends ..., B extends ..., ...> = SomeVeryLongTypeName<A, B, ...>...

Fresh: global state

Is it possible to have a global state that can be accessed from anywhere? Currently I'm passing the Request object to many deeply nested server-rendered components, because I need to read the request hostname from it. I wish there was a way I could skip passing it through props.

Run Deno on Linux without /proc mounted

I have a few automatic scripts using deno to run stuff, and wanted to migrate them to another Machine. For various reasons deno doesn't run on the new Host (mainly missing Libraries) so I wanted to run deno in a chroot. However that fails, because /proc is not mounted in the chroot and for some reason deno seems to rely on /proc/self/exe. Is there a way to not need that? Or do I need to mount /proc in the chroot?

Running deno in distroless image does not work well

Hey, I have the following Dockerfile: ```dockerfile FROM node:lts AS build WORKDIR /app...

Reasons to choose Node.js

I've been tasked to write a list of pros/cons of Deno in comparison to Node.js. I am quite honestly having a hard time formulating that many "pros" of Node.js. Could someone please let me know: what good reasons are there to choose Node.js today?...

Reejs not working on Deno v1.34

``js deno run -A npm:reejs [INFO] Saving important data... [TIP] If the error in your code is in any of the following extensions (.ts, .tsx, .jsx), kindly not focus on the line number as the line numbers depict the compiled code and not the original one. Add DEBUG=true` to your environment variables to see the original code. TypeError: Could not resolve 'node:repl' from 'file:///home/ren/.cache/deno/npm/registry.npmjs.org/@reejs/imports/2.1.13/nativeImport.js'....