Deno

D

Deno

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

Join
Iivandpf5/3/2024

PHP to Javscript little code

```php if ($_SERVER["REQUEST_METHOD"] == "POST") { if (isset($_FILES["file"])) { $file= $_FILES["file"]; }...
Aanggoran5/2/2024

SpeechRecognition is not found

There are other SpeechRecognition interfaces, but the main one isn't available.
No description
DDNA5/2/2024

Ignoring `deno(redirect)` in vscode?

When deno extension in vscode is enabled, i get this warning, that my imported file was redirected. I know, that this is probably a bad practise, but this is what i want to have. So is it possible to just hide this squiggles? I couldn't really find anything in the extension's settings
No description
CCole5/2/2024

Adding a max runtime timeout to Deno JS execution

As the title states, I would like to be able to add a timeout to any JS code that I am executing in my deno_core JsRuntime in rust. I haven't been able to find any way to get this to work as all solutions seem to require that Deno yields the async runtime which it doesn't ever seem to do until it finishes. Any advice you could give or places you could point to would be extremely helpful, thanks!
KKuwazy5/1/2024

Do you know how I can call a C variadic function in FFI Deno?

I want to call a C variadic function from Deno but I looked at the documentation and it doesn't seem possible. Solutions ? Thanks in advance.
Mmfrancis1075/1/2024

KV watch prefix?

Is there a way to watch a prefix. I would like to be able to watch for any record added to a specific key prefix. ``` export async function logData(jsonObject: Object) {...
ZZidan5/1/2024

Deno LSP Issue with import maps?

I've been using an import map throughout my project like this: deno.json file at the projects' root that has a map like this: ```{ "imports": { "atlas": "https://deno.land/x/atlas_sdk@v1.1.1/mod.ts",...
Ccsjh5/1/2024

Using `Deno.FsFile.prototype.readable` with `Response`

I was trying to stream a file into a response with the snippet: ```ts const file = await Deno.open(path); const resp = new Response(file.readable); file.close();...
KKyleJune5/1/2024

react-helmet-async missing HelmetProvider export

I'm on the canary version testing out jsxImportSourceTypes and ran into an issue when switching to using npm specifiers for react@18.0.2. I have the following entry in my deno.jsonc imports.
"react-helmet-async": "npm:react-helmet-async@2",
"react-helmet-async": "npm:react-helmet-async@2",
My editor has no issue showing that it recognizes the HelmetProvider. You can see in the attached screenshots that it is recognizing that I'm importing the class. However, when my code runs, I get the following error....
No description
Jjcayzac5/1/2024

Where has std/hash/sha3.ts gone?

Basically what the title says. This was removed from std/ at some point, but I can't find the current location of the module anymore (looking it up on deno.land returns nothing).
Llaurynas4/30/2024

Loading a module with `.load_main_es_module_from_code()` and TS module loader doesn't transpile

While working on a script runtime I ran into a curious issue where the main module I load doesn't get transpiled. This may well be my lack of understanding of how deno_core crate works but the case seemed so mind boggling to me I created a small repo for reproduction. The TLDR is: 1. I have a script.ts that I load and evaluate at runtime. 2. The script.ts uses functions from a helper library script-api.ts...
Mmwright4/30/2024

StaticModuleLoader: why must the ModuleSpecifier be a URL?

hey everyone, I'm trying to pass a StaticModuleLoader to my runtime to enable specific imports. Each module for the StaticModuleLoader is specified by a ModuleSpecifier (type alias for url::Url) and the corresponding code (impl IntoModuleCodeString). I'm wondering why the module has to be specified by a url. I read here https://choubey.gitbook.io/internals-of-deno/foundations/resolve_url_or_path that the url is crucial because it allows Deno to locate and access the modules. But I'm already providing the code in form of the value that implements IntoModuleCodeString. If I want to enable an import such as import foo from "bar"; in the code that runs on the runtime, what would the ModuleSpecifier url look like that I have to pass to the StaticModuleLoader?...
Aanggoran4/30/2024

Writing CSS in Fresh

Are there any alternatives in how we write CSS other than Tailwind-like (inline & abbreviated)? I personally like the normal key-value & scoped styling. But it seems that tool like styled-components is an anti-pattern to Fresh....
JJakob4/30/2024

Passing C enum to function and read in TypeScript

First of all I am not a trained software developper, so please forgive me if I am missing some basics. I am trying to build a wrapper around a dynamic library to IEC 61850 communication.
On the the exposed functions of that library is IedConnection_connect(..., IedClientError error, ...) , where IedClientError is a enum with 23 entries. To be able to use the library I need to ...
Nnelly544/28/2024

intergrating Flowbite with fresh

I want to intergrate Flowbite with Fresh. Any idea on the best way to go about this? And will I be losing anything in terms of speed if i use Flowbite?
Aalina 🌸4/28/2024

get file path from FsFile

given a Deno.FsFile, is there a way to get its path (or at least a filename)? i can't really see a way to do that judging by the typings e.g. ```ts...
Ssibi_73354/28/2024

bulr to rtransparent gradient

I am working on reactjs project in the project it should have blur to transperant bg take a look at the screen shot blur was bit sharp that was not good to see suggest me a help then i will share my code
No description
Ssamme4/28/2024

Streaming video from browser to deno server

Trying to stream video from Chrome to my local Deno server but having trouble understanding how to pipe things up correctly. When I visit localhost:8000, which hits the /video endpont via the <video> element, the /receive endpoint throws this error: ```js...
EENEd, Edd n Eddy4/28/2024

Migrating from Deno.run to Deno.command, how to readLines?

At the moment I have this: ```ts const command = new Deno.command('...'); for await (const line of readLines(command.stderr!)) { // ......
Next