Deno

D

Deno

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

Join

Adding npm specifiers to deno.json

How do i add a specific version of an npm module to the cache?

How do I enqueue_microtask from other thread

so Isolate.enqueue_microtask is obviously not send/sync so I think the only option is to use std::sync::mpsc::channel and use Receiver.try_recv to get the values from Sender on other thread. The problem is that I am being a rust newbie don't know how to combine them on the single thread or if it actually possible. I somehow need to wake up the runtime when the Sender actually sends the value, I think I can wrap try_recv with poll_fn and use something like tokio's select! macro...

Can't connect to http server on official alpine deno with std serve.

I'm using the official alpine docker container to run deno, listening on port 8080, but a simple curl to it and I can't connect. Seems like it isn't listening at all. Deno server shows no error. ``` Use the official Deno Docker image with version 1.32.0 FROM denoland/deno:alpine-1.32.0 ...

calling a javascript function and waiting for the promise with `rusty_v8`

```rust let result = function.call(scope, recv, &[]).expect("couldnt run"); /*i got this result which is a promise. now how do i get the value of the promise let value = ??...

Deno KV: subtract with `sum` operation?

If I do .sum([key], 1n) the value is increased by 1. How can I decrease it? I tried .sum([key], -1n) but it doesn't work.

Proxying a Rust API using FFI?

I have a rust application that serves a rest api that runs in a container. I also have a deno cli that acts as a client for the api, among other things. A usecase came up where a user of the CLI would want to spin up the rust API for "testing" but will not have access to the api. For this use case, I would like to package the rust api with the deno cli as a library and add a command to the cli named something like serve, which starts the rust web server. The problem is that the deno cli already has its own serve command with its own rest api. Is it possible to hook the rust api up with the deno native http server?...

deno autocomplete importing npm module from file

How do I fix auto import from doing things like this? It is super annoying....

How to use declarations from `vite/client`?

There are declarations: https://esm.sh/v126/vite@4.3.9/client.d.ts According to documentation, I need to specify types in compilerOptions: ```json "compilerOptions": { "allowJs": false,...

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?